%global     commit     18a39ba68a5c43730802e18570ba512c6c0e84d9
%global     githash    %(c=%{commit}; echo ${c:0:7})
%global     gitdate    20180316
%global     gittime    1045

Name:       corebird
Version:    1.7.4
Release:    4.%{gitdate}%{gittime}git%{githash}%{?dist}
Epoch:      1
Summary:    Native Gtk+ Twitter client for the Linux desktop

Group:      Applications/Internet
License:    GPLv3
URL:        https://github.com/baedert/corebird
Source:     https://github.com/baedert/%{name}/archive/%{commit}/%{name}-v%{version}-%{githash}.tar.gz

BuildRequires:  vala-devel >= 0.28
BuildRequires:  libtool >= 2.4.2
BuildRequires:  automake >= 1.13
BuildRequires:  gettext-devel >= 0.19.7
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.20
BuildRequires:  pkgconfig(libsoup-2.4) >= 2.42
BuildRequires:  pkgconfig(gee-0.8) >= 0.8
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0) >= 1.6
BuildRequires:  pkgconfig(gstreamer-plugins-bad-1.0) >= 1.6
BuildRequires:  pkgconfig(json-glib-1.0)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(libnotify)
BuildRequires:  desktop-file-utils libappstream-glib
BuildRequires:  pkgconfig(gspell-1)

Requires:       hicolor-icon-theme
Requires:       dconf
Requires:       gstreamer1-plugins-good-gtk%{?_isa}

Recommends:     gdouros-symbola-fonts

%description
Corebird is a native Gtk+ Twitter client for the Linux desktop.

%prep -n
%setup -q -n %{name}-%{commit}

%build
NOCONFIGURE=yes ./autogen.sh
%configure --prefix=%{_prefix}
%make_build

%install
%make_install

%find_lang corebird

%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/org.baedert.corebird.desktop

%post
%{_bindir}/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    %{_bindir}/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
    %{_bindir}/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    %{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
%{_bindir}/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files -f %{name}.lang
%license COPYING
%{_bindir}/corebird
%{_datadir}/applications/org.baedert.corebird.desktop
%{_datadir}/metainfo/org.baedert.corebird.appdata.xml
%{_datadir}/glib-2.0/schemas/org.baedert.corebird.gschema.xml
%{_datadir}/icons/hicolor/*/apps/corebird.png
%{_datadir}/dbus-1/services/org.baedert.corebird.service
%{_mandir}/man1/corebird.1*

%changelog
* Mon Sep 26 2016 Heiko Adams <heiko.adams@gmail.com> - 1.3.2-201609232005git0cb3132
- Bump version to 1.3.2

* Sun Jul 27 2014 Heiko Adams <heiko.adams@gmail.com> - 0.8.0-201407271545git0b23800
- build with -Werror=format-security

* Mon Jul 14 2014 Heiko Adams <heiko.adams@gmail.com> - 0.8.0-1.201407141540git9cbecc0
- updated dependencies for multimedia- and basic emoji-support

* Tue Dec 03 2013 Heiko Adams <heiko.adams@gmail.com> - 0.5-2
- small improvements to specfile

* Thu Nov 28 2013 Heiko Adams <heiko.adams@gmail.com> - 0.5-1
- update to 0.5

* Wed Nov 20 2013 Heiko Adams <heiko.adams@gmail.com> - 0.4-1.20131120git9fea734
- updated to latest git snapshot
- removed fontfile

* Sat Nov 16 2013 Heiko Adams <heiko.adams@gmail.com> - 0.4-1.20131116gita0180d9
- added appdata.xml
- updated to latest git snapshot

* Sun Nov 03 2013 Heiko Adams <heiko.adams@gmail.com> - 0.4-1.20131012git001ffcb
- bump Version to 0.4
- remove librsvg2-tools from build-dependencies

* Sun Oct 13 2013 Heiko Adams <heiko.adams@gmail.com> - 0.3-2.20131012git001ffcb
- added missing license file

* Sat Oct 12 2013 Heiko Adams <heiko.adams@gmail.com> - 0.3-1.20131012git001ffcb
- initial release