diff --git a/apx-e7766f1.tar.gz b/apx-e7766f1.tar.gz deleted file mode 100644 index 12afe7b..0000000 Binary files a/apx-e7766f1.tar.gz and /dev/null differ diff --git a/apx.png b/apx.png deleted file mode 100644 index cc78962..0000000 Binary files a/apx.png and /dev/null differ diff --git a/apx.spec b/apx.spec index cd0ea76..aeac9b0 100644 --- a/apx.spec +++ b/apx.spec @@ -1,31 +1,32 @@ %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%global date 20141101 -%global commit e7766f1ea8bc328b9320d72f8567a33a0516ff47 +%global date 20150118 +%global commit e978d9562e574f7e8675ee861d7f11530eb58e18 %global scommit %(c=%{commit}; echo ${c:0:7}) -%global readme README.md Name: apx Version: 0 -Release: 0.6.%{date}git%{scommit}%{?dist} +Release: 0.7.%{date}git%{scommit}%{?dist} Summary: QIX clone, cut into and claim the square area License: MIT URL: https://github.com/projecthamster/%{name} Source0: https://github.com/projecthamster/%{name}/archive/%{scommit}/%{name}-%{scommit}.tar.gz -Source10: https://camo.githubusercontent.com/e5a26552ee632107f0031b5ca06f521a720b94fd/68747470733a2f2f6661726d382e737461746963666c69636b722e636f6d2f373433342f31333832333837383333355f653234326163316332335f6f2e706e67#/%{name}.png +# picture link taken from README.md +Source10: https://farm8.staticflickr.com/7434/13823878335_e242ac1c23_o.png#/%{name}.png BuildArch: noarch BuildRequires: python2 python2-devel python-setuptools -BuildRequires: desktop-file-utils +BuildRequires: desktop-file-utils libappstream-glib Requires: python2 +Requires: hicolor-icon-theme -# we need also cairo with pygobject3 +# need introspection for cairo Requires: pygobject3-base pycairo -Requires: %{name}-fonts = %{version}-%{release} +Requires: %{name}-fonts = %{version}-%{release} %description APX is a QIX clone with minor differences in game-play from the original. @@ -48,51 +49,20 @@ URL: http://www.04.jp.org/ BuildArch: noarch %description fonts -Font named 04b03 for the game %{name}. -Redistribution from http://www.04.jp.org/ +Fonts for the game %{name}. +Redistribution from: http://www.04.jp.org %prep %setup -qn %{name}-%{commit} -sed -i 's|%{name}.sqlite|%{_sharedstatedir}/%{name}/%{name}.sqlite|' scores.py - -# FIXME question location for font (subpackage/folder) and license (documentation) -# https://fedoraproject.org/wiki/Packaging:FontsPolicy#Package_layout_for_fonts -mv assets/04b03_LICENSE . - -# prepare setuptools -mkdir %{name} -cp -a *.py lib %{name} +sed -i s,Games,Game, data/*.desktop # remove shebang find %{name} -name '*.py' |xargs sed -i '1{\@^#!/usr/bin/env python@d}' - -# configure setuptools -# https://github.com/projecthamster/apx/issues/6 -cat > setup.py << EOF -#!/usr/bin/env %{__python2} -# - coding: utf-8 - -import os -from setuptools import setup -setup( - name = "%{name}", - version = "%{version}git%{scommit}", - author = "Toms Bauģis", - author_email = "toms.baugis at gmail.com", - description = ("%{summary}"), - license = "%{license}", - keywords = "", - url = "%{url}", - packages=['%{name}', '%{name}.lib'], - long_description=open(os.path.join(os.path.dirname(__file__), '%{readme}')).read(), - classifiers=[ - "Development Status :: 2 - Pre-Alpha", - "Environment :: X11 Applications :: GTK", - "Intended Audience :: End Users/Desktop", - "Topic :: Games/Entertainment", - "License :: OSI Approved :: %{licence} License", - ], -) -EOF +# do not try to install the font again and again +sed -i s,utils.install_font.*,\#, bin/%{name} +sed -i s,fonts/04b03,fonts/%{name}, setup.py +# documentation is handled properly in %%doc +sed -i s,'*_LICENSE',, setup.py %build @@ -100,61 +70,56 @@ EOF %install -install -d %{buildroot}%{_sharedstatedir}/%{name} -install -m0644 -t %{buildroot}%{_sharedstatedir}/%{name} apx.sqlite %{__python2} setup.py install -O1 --skip-build --root %{buildroot} +mkdir -p %{buildroot}%{_pkgdocdir} +find %{buildroot}%{_datadir}/fonts -name '*_LICENSE' -exec mv {} %{buildroot}%{_pkgdocdir} \; + + +%check +desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop +# FIXME weird errors +#appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml -# font -cp -ap assets %{buildroot}%{python2_sitelib}/%{name} - -cd %{buildroot} - -# easy start -install -d .%{_bindir} -cat > .%{_bindir}/%{name} << EOF -#!/usr/bin/sh -cd %{python2_sitelib}/%{name} -%{__python2} %{name}.py -EOF -chmod a+x .%{_bindir}/%{name} - -#icon and desktop -install -d .%{_datadir}/pixmaps -install -m0644 %{SOURCE10} .%{_datadir}/pixmaps -install -d .%{_datadir}/applications -cat > .%{_datadir}/applications/%{name}.desktop << EOF -[Desktop Entry] -Name=APX -Comment=%{summary} -Exec=%{name} -Icon=%{name} -Terminal=false -Type=Application -StartupNotify=false -Categories=Game; -EOF -desktop-file-validate .%{_datadir}/applications/%{name}.desktop + +%post +/bin/touch --no-create %{_datadir}/icons/hicolor &>/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 + +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files -%doc AUTHORS LICENSE %{readme} -%{_sharedstatedir}/%{name}/ +%doc AUTHORS LICENSE README.md +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/*.sqlite +%{_datadir}/%{name}/icons/ %dir %{python2_sitelib}/%{name} %{python2_sitelib}/%{name}/*.py* %{python2_sitelib}/%{name}/lib/ %{python2_sitelib}/*.egg-info/ %{_bindir}/%{name} -%{_datadir}/pixmaps/*.png %{_datadir}/applications/*.desktop +%{_datadir}/appdata/*.appdata.xml %files fonts -%doc 04b03_LICENSE -%dir %{python2_sitelib}/%{name}/assets -%{python2_sitelib}/%{name}/assets/04b03.ttf +%doc data/*_LICENSE +%dir %{_datadir}/fonts/* +%{_datadir}/fonts/*/*.ttf %changelog -* Mon Jan 12 2015 Raphael Groner (Builder) - 0-0.6.20141101gite7766f1 +* Sun Jan 18 2015 Raphael Groner - 0-0.7.20150118gite978d95 +- new upstream snapshot +- remove obsolete tweaks +- legal fonts subpackage + +* Mon Jan 12 2015 Raphael Groner - 0-0.6.20141101gite7766f1 - R: pycairo without -devel * Fri Dec 19 2014 Raphael Groner - 0-0.5.20141102gite7766f1 diff --git a/sources b/sources deleted file mode 100644 index ea094cb..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -f6d769b4bc5dd34726a30b6bfbdbfe65 apx-e7766f1.tar.gz