%global srcname cinnamon-applet %global srcurl https://github.com/projecthamster/%{srcname} # issues/21, Questionable licensing %global commit0 7fbc81cda716031314d4479f358a2b1fcd53c2e6 %global gitdate 20160728 %if 0%{?gitdate} %global srcdir %{srcname}-%{commit0} %else %global srcdir %{srcname}-%{version} %endif %global instdir %{_datadir}/cinnamon/applets/%{name} Name: hamster-%{srcname} Version: 0.2 %if 0%{?gitdate} Release: 1.%{gitdate}git%(c=%{commit0}; echo ${c:0:7} )%{?dist} %else Release: 1%{?dist} %endif Summary: Cinnamon applet for hamster time tracker License: GPLv3+ URL: http://projecthamster.org %if 0%{?gitdate} Source0: %{srcurl}/archive/%{commit0}/.tar.gz %else Source0: %{srcurl}/archive/%{version}/%{srcdir}.tar.gz %endif BuildArch: noarch BuildRequires: gettext # runtime Requires: cinnamon Requires: hamster-time-tracker Requires: dbus-x11 %description %{summary}. %prep %autosetup -n%{srcdir} find -name \*.mo -print -delete %build # nothing but compile translations find -name \*.po -print -exec msgfmt -o $(dirname '{}')/$(basename '{}' .po).mo '{}' \; %install install -d %{buildroot}%{instdir} install -p -m0644 -D *.js -t %{buildroot}%{instdir} cp -ap images schemas -t %{buildroot}%{instdir} cp -ap locale %{buildroot}%{_datadir} ln -s -t %{buildroot}%{instdir} ../../../locale %find_lang %{name} --all-name %files -f %{name}.lang %license COPYING %doc CHANGES %{instdir}/ %exclude %{_datadir}/locale/*/LC_MESSAGES/*.po %changelog * Sun Aug 7 2016 Raphael Groner - 0.2-1.20160728git7fbc81c - initial