9d4c239
%global pkgversion %(echo %version|sed s/\\\\\.//g) 
9d4c239
9d4c239
Name:           whichwayisup
9d4c239
Version:        0.7.9
9860b9d
Release:        12%{?dist}
9d4c239
Summary:        2D platform game with a slight rotational twist
9d4c239
9d4c239
# All game content, sounds and graphics are licensed under
9d4c239
# Creative Commons 3.0 Attribution license.
9d4c239
License:        GPLv2 and CC-BY
9d4c239
URL:            http://www.oletus.fi/static/whichwayisup/
9d4c239
Source0:        http://www.oletus.fi/static/whichwayisup/%{name}_b%{pkgversion}.zip
9d4c239
# Desktop file taken from Debian
9d4c239
Source1:        %{name}.desktop
9d4c239
# AppData file provided by Iwicki Artur
9d4c239
Source2:        %{name}.appdata.xml
9d4c239
# Man page taken from Debian
9d4c239
Source3:        %{name}.6
9d4c239
# Under certain circumstances whichwayisup detected keyboards as joysticks
9d4c239
# http://bugs.debian.org/710162
9d4c239
Patch0:         %{name}-0.7.9-check_for_joystick_axes_not_null.patch
9d4c239
# Initialize only required pygame modules
9d4c239
# http://bugs.debian.org/432015
9d4c239
Patch1:         %{name}-0.7.9-initialize_only_required_pygame_modules.patch
a42e748
# Port game to python3
a42e748
# https://bugs.debian.org/912500
a42e748
Patch2:         %{name}-0.7.9-python3.patch
9d4c239
9d4c239
BuildArch:      noarch
9d4c239
9d4c239
BuildRequires:  ImageMagick
9d4c239
BuildRequires:  desktop-file-utils
9d4c239
BuildRequires:  libappstream-glib
a42e748
Requires:       python3-pygame
9d4c239
Requires:       bitstream-vera-sans-fonts
9d4c239
Requires:       hicolor-icon-theme
9d4c239
9d4c239
%description
9d4c239
A traditional and challenging 2D platform game with a slight rotational 
9d4c239
twist. Help a mysterious big-eared salaryman named Guy find his keys in a 
9d4c239
labyrinth of dangers and bad dialogue.
9d4c239
9d4c239
%prep
9d4c239
%autosetup -n %{name} -p1
9d4c239
9d4c239
# Fix script interpreter
a42e748
sed -i 's!/usr/bin/env python3!/usr/bin/python3!' run_game.py
9d4c239
9d4c239
# Change data path
9d4c239
sed -i "s!libdir = .*!libdir = '%{_datadir}/%{name}/lib'!" run_game.py
9d4c239
9d4c239
# Fix end-of-line encoding
9d4c239
sed -i 's/\r//' changelog.txt
9d4c239
9d4c239
# Remove Thumbs.db
9d4c239
rm data/pictures/Thumbs.db
9d4c239
9d4c239
9d4c239
%build
9d4c239
# Empty
9d4c239
9d4c239
9d4c239
%install
9d4c239
# Install launcher script
9d4c239
install -d %{buildroot}%{_bindir}
9d4c239
install -m 755 -p run_game.py %{buildroot}%{_bindir}/%{name}
9d4c239
9d4c239
# Install game and data
9d4c239
install -d %{buildroot}%{_datadir}/%{name}
9d4c239
cp -pr data lib %{buildroot}%{_datadir}/%{name}
9d4c239
9d4c239
# Install icons
9d4c239
for i in 0 1 2 ; do
9d4c239
  px=$(expr 64 - ${i} \* 16)
9d4c239
  mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${px}x${px}/apps
9d4c239
  convert lib/whichway.ico[${i}] \
9d4c239
    %{buildroot}%{_datadir}/icons/hicolor/${px}x${px}/apps/%{name}.png
9d4c239
done
9d4c239
9d4c239
# Install desktop file
9d4c239
desktop-file-install \
9d4c239
  --dir %{buildroot}%{_datadir}/applications \
9d4c239
  %{SOURCE1}
9d4c239
9d4c239
# Install AppData file
c304002
install -d %{buildroot}%{_datadir}/metainfo
c304002
install -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/metainfo
c304002
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdata.xml
9d4c239
9d4c239
# Install man page
9d4c239
install -d %{buildroot}%{_mandir}/man6
9d4c239
install -p -m 644 %{SOURCE3} %{buildroot}%{_mandir}/man6/
9d4c239
9d4c239
# Symlink system font
9d4c239
rm %{buildroot}%{_datadir}/%{name}/data/misc/Vera.ttf
9860b9d
ln -s %{_datadir}/fonts/bitstream-vera-sans-fonts/Vera.ttf \
9d4c239
    %{buildroot}%{_datadir}/%{name}/data/misc/Vera.ttf
9d4c239
9d4c239
%files
9d4c239
%doc README.txt changelog.txt
9d4c239
%{_bindir}/%{name}
9d4c239
%{_datadir}/%{name}
a42e748
%{_metainfodir}/%{name}.appdata.xml
9d4c239
%{_datadir}/applications/%{name}.desktop
9d4c239
%{_datadir}/icons/hicolor/*/apps/%{name}.png
9d4c239
%{_mandir}/man6/%{name}.6*
9d4c239
9d4c239
9d4c239
%changelog
9860b9d
* Sat May 23 2020 Andrea Musuruane <musuruan@gmail.com> - 0.7.9-12
9860b9d
- Fixed font path for F32+ (BZ #1836454)
9860b9d
ff4a406
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.9-11
ff4a406
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
ff4a406
a42e748
* Fri Aug 09 2019 Andrea Musuruane <musuruan@gmail.com> - 0.7.9-10
a42e748
- Ported to python3 (BZ #1738142)
a42e748
29f53b4
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.9-9
29f53b4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
29f53b4
b4496b0
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.9-8
b4496b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
b4496b0
a73e352
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.9-7
a73e352
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a73e352
c304002
* Sat Feb 24 2018 Andrea Musuruane <musuruan@gmail.com> - 0.7.9-6
c304002
- Used new AppData directory
c304002
ba1b2f5
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.9-5
ba1b2f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ba1b2f5
b93642c
* Thu Jan 18 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.7.9-4
b93642c
- Remove obsolete scriptlets
b93642c
9d4c239
* Sat Jul 08 2017 Andrea Musuruane <musuruan@gmail.com> - 0.7.9-3
9d4c239
- Added missing BR
9d4c239
9d4c239
* Mon Jun 26 2017 Andrea Musuruane <musuruan@gmail.com> - 0.7.9-2
9d4c239
- Removed wrapper script and changed data path in launcher script
9d4c239
- Added a patch from Debian to initialize only required pygame modules
9d4c239
- Added AppData file
9d4c239
- Removed Thumbs.db file (Windows Explorer thumbnail database)
9d4c239
- Fixed macro style
9d4c239
- Minor fixes
9d4c239
9d4c239
* Sun Jun 25 2017 Andrea Musuruane <musuruan@gmail.com> - 0.7.9-1
9d4c239
- First release
9d4c239