# Versioning this package is a little odd. It seems that the Mageia packager
# grabs from Git and creates version numbers as 1.7.{number of commits since 1.7}
# which means upstream don't tag releases since it breaks his script.
# (see: https://github.com/oferkv/phototonic/issues/214 ) so I will now package from Git.
%global commit0 24d7b78650091552d561c4d6c5ec5e5e6ce8bfcc
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Name: phototonic
# here 21 is the number of commits since 1.7 - this seems to be the style for upstream.
# since the first version packaged for Fedora was 1.7.20 this format needs to be kept
# for upgrades to work - I can't drop the number and just use the git tag unfortunately.
Version: 1.7.21
Release: 20161102git%{shortcommit0}%{?dist}
Summary: Image viewer and organizer
License: GPLv3
URL: http://oferkv.github.io/phototonic/
Source0: https://github.com/oferkv/%{name}/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz
BuildRequires: gcc-c++
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-linguist
BuildRequires: desktop-file-utils
BuildRequires: exiv2-devel
%description
phototonic is a fast and functional image viewer and organizer, inspired by the
traditional image viewer design (i.e. thumbnails and viewer layouts).
%prep
%setup -q -n %{name}-%{commit0}
%build
%{qmake_qt5}
make %{?_smp_mflags}
%install
make install INSTALL_ROOT=%{buildroot}
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%files
%license COPYING
%doc ChangeLog
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
%{_datadir}/pixmaps/%{name}.png
%doc
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :
%postun
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%changelog
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.21-20161102git24d7b78
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Nov 01 2016 Michael Cullen <michael@cullen-online.com> - 1.7.21-20161101git24d7b78
- Updated to newer upstream commit, adding Portuguese language support.
* Tue May 10 2016 Michael Cullen <michael@cullen-online.com> - 1.7.20-2
- Fixed review comment. Added update-desktop-database calls.
* Thu May 5 2016 Michael Cullen <michael@cullen-online.com> - 1.7.20-1
- Pulled in properly tagged release from upstream
* Mon May 2 2016 Michael Cullen <michael@cullen-online.com> - 1.7.1-1
- Initial Package