Blob Blame History Raw
Name:           apx
Version:        0.1
Release:        12%{?dist}
Summary:        QIX clone, cut into and claim the square area

License:        MIT
URL:            https://github.com/tstriker/%{name}
Source0:        %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# Pull request #9: Fix: Don't try to remove the same source more than once.
Patch0:         %{url}/commit/d57acd9ab84e17bd53a757072a94a51f3e2ebe65.patch
# Pull request #10: Fix Rectangle.union() call, Get rid of PyGIWarnings 
Patch1:         %{url}/commit/e7f78358b08e57c3e91e0d4e706c1a3117db5142.patch
# Pull request #11: 2to3 modifications
Patch2:         %{url}/commit/cb033978988061dd159d05d5cb1ebbdd1c2562bb.patch
# knits (2to3 rendered some bugs)
Patch3:         %{url}/commit/51f8f3d9509f733a41188a80326bd26a16779cdf.patch
# issue #8: move apx icon to share/icons/hicolor/scalable/
Patch4:         %{url}/commit/2e75f50786455ed0913850b4b8a774189321ef07.patch
# PR #12: Crash with Python3: slots do not work for class attribute
Patch5:         %{url}/commit/6d226e8f925c0d6ae5523e3b49a437a498bff0f0.patch
# issue #14: Difficult to see with some desktop themes
Patch6:         %{url}/commit/3e87371d592e01d35b1a09e9c17f2b7c2abc8273.patch
# PR #15: hexadecimal string formatter needs integer instead of float
Patch7:         %{url}/commit/dc4eb6963243162a8452b878e52c516e75f1292a.patch

BuildArch:      noarch

BuildRequires:  python3-devel python3-setuptools
BuildRequires:  fontpackages-devel
BuildRequires:  desktop-file-utils libappstream-glib

Requires:       python3

Requires:       hicolor-icon-theme

# need introspection for cairo
Requires:       python3-gobject
Requires:       python3-cairo

Requires:       %{name}-fonts = %{version}-%{release}

%description
APX is a QIX clone with minor differences in game-play from the original.
Read about the original: http://en.wikipedia.org/wiki/Qix

Use arrow keys to move around the perimeter of square, hold down Space or Shift
to cut into the area. Connect back to perimeter to claim the area.

Your objective is to claim 75 percent or more to proceed to the next level.

Claiming with Shift key will be slower but give you double the points.

For every claimed full percent over 75 percent you get extra 1000 points.


%package fonts
Summary:       Fonts for the game %{name}
License:       CC-BY
URL:           http://www.04.jp.org/
BuildArch:     noarch
Requires:      fontpackages-filesystem

%description fonts
Fonts for the game %{name}.
Redistribution from: http://www.04.jp.org


%prep
%autosetup -p1
sed -i s,Games,Game, data/*.desktop
# add right shebang
sed -i '1d;2i#!%{__python3}' bin/%{name}
find %{name} -name \*.py |xargs sed -i '/^#!\//, 1d'
# do not try to install the font again and again
sed -i /utils.install_font.*/d bin/%{name}
sed -i -r 's,(fonts/)04b03,\1%{name},' setup.py

%build
%py3_build

%install
%py3_install
# avoid misplaced license file
find %{buildroot} -name '*LICENSE' -print -delete

%check
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml


%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
%license LICENSE
%doc AUTHORS README.md
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*.sqlite
%{_datadir}/icons/hicolor/scalable/*.svg
%{python3_sitelib}/*
%{_bindir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/appdata/*.appdata.xml

%_font_pkg *.ttf
%license data/*_LICENSE


%changelog
* Sun Jul 31 2016 Raphael Groner <projects.rg@smart.ms> - 0.1-12
- add another patch for python3

* Fri Jul 29 2016 Raphael Groner <projects.rg@smart.ms> - 0.1-11
- add patch: Difficult to see with some desktop themes

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-10
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Sun Jul 10 2016 Raphael Groner <projects.rg@smart.ms> - 0.1-9
- note new upstream URL

* Sat Jul 09 2016 Raphael Groner <projects.rg@smart.ms> - 0.1-8
- fix crash with python3, rhbz#1347738

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Dec 27 2015 Raphael Groner <projects.rg@smart.ms> - 0.1-6
- fix Requires again

* Sat Dec 26 2015 Raphael Groner <projects.rg@smart.ms> - 0.1-5
- fix b0rken dependencies to cairo
- apply acceptance of upstream 2to3
- apply upstream patch to revert removal of R: hicolor-icon-theme
- comply to fonts packaging policy

* Fri Dec 25 2015 Raphael Groner <projects.rg@smart.ms> - 0.1-4
- apply latest upstream patches
- port to python3
- enable appdata validation
- remove R: hicolor-icons-theme

* Sat Sep 26 2015 Raphael Groner <projects.rg@smart.ms> - 0.1-3
- avoid duplicated but misplaced license file from doc folder

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Feb 23 2015 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.7.20150118gite978d95
- first official upstream release v0.1

* Wed Jan 28 2015 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.8.20150118gite978d95
- introduce license macro

* Sun Jan 18 2015 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.7.20150118gite978d95
- new upstream snapshot
- remove obsolete tweaks
- legal fonts subpackage

* Mon Jan 12 2015 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.6.20141101gite7766f1
- R: pycairo without -devel

* Fri Dec 19 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.5.20141102gite7766f1
- require cairo
- honor AUTHORS
- use date of last commit (instead of export/clone)

* Mon Nov 03 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.4.20141102gite7766f1
- proper usage of macro python2_sitelib
- comment about strange location for redistributed font

* Sun Nov 02 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.3.20141102gite7766f1
- new snapshot: license change for font

* Wed Oct 29 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.2.20141010git853fdd0
- fix Requires
- fix description
- preserve timestamps

* Sat Oct 11 2014 Raphael Groner <projects.rg [AT] smart.ms> - 0-0.1.20141010git853fdd0
- initial