%global repo_name LD25 %global repo_commit ee1ca09e36e5d1290295a7def567f31f1b551300 Name: colorful Version: 1.2 Release: 7%{?dist} Summary: Side-view shooter game License: zlib with acknowledgement URL: https://svgames.pl Source0: https://github.com/suve/%{repo_name}/archive/%{repo_commit}.tar.gz#/%{repo_name}-%{repo_commit}.tar.gz # Needed for compilation BuildRequires: fpc, SDL-devel, SDL_image-devel, SDL_mixer-devel, mesa-libGL-devel Requires: colorful-data, SDL, SDL_image, SDL_mixer, mesa-libGL # Needed to properly build the RPM BuildRequires: desktop-file-utils %description Colorful is a simple side-view shooter game, where the protagonist travels a maze of caves and corridors in order to collect color artifacts. %package data Summary: Game data for Colorful BuildArch: noarch # BuildRequires: # Requires: %description data Data files (graphics, maps, sounds) required to play Colorful. %prep %autosetup -n %{repo_name}-%{repo_commit} %build cd src/ make clean make package %install install -m 755 -d %{buildroot}/%{_bindir}/ install -m 755 -d %{buildroot}/%{_mandir}/man6/ install -m 755 -d %{buildroot}/%{_mandir}/pl/man6/ install -m 755 -d %{buildroot}/%{_datadir}/applications/ install -m 755 -d %{buildroot}/%{_datadir}/icons/hicolor/32x32/apps/ install -m 755 -d %{buildroot}/%{_datadir}/appdata/ install -m 755 src/%{name} %{buildroot}/%{_bindir}/%{name} install -m 644 pkg/%{name}-english.man %{buildroot}/%{_mandir}/man6/%{name}.6 install -m 644 pkg/%{name}-polish.man %{buildroot}/%{_mandir}/pl/man6/%{name}.6 desktop-file-install \ --dir=%{buildroot}/%{_datadir}/applications/%{name}.desktop \ pkg/%{name}.desktop install -m 644 pkg/%{name}.appdata.xml %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml install -m 644 pkg/%{name}-32x32.png %{buildroot}/%{_datadir}/icons/hicolor/32x32/apps/%{name}.png # For the -data subpackage install -m 755 -d %{buildroot}/%{_datadir}/suve/%{name}/ install -m 755 -d %{buildroot}/%{_datadir}/suve/%{name}/gfx/ install -m 755 -d %{buildroot}/%{_datadir}/suve/%{name}/sfx/ install -m 755 -d %{buildroot}/%{_datadir}/suve/%{name}/intro/ install -m 755 -d %{buildroot}/%{_datadir}/suve/%{name}/map/org/ install -m 755 -d %{buildroot}/%{_datadir}/suve/%{name}/map/tut/ cp -R ./gfx/ %{buildroot}/%{_datadir}/suve/%{name}/ cp -R ./sfx/ %{buildroot}/%{_datadir}/suve/%{name}/ cp -R ./intro/ %{buildroot}/%{_datadir}/suve/%{name}/ cp -R ./map/ %{buildroot}/%{_datadir}/suve/%{name}/ # Needed for the icon cache to work correctly %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 || : # End of icon cache related stuff %files %{_bindir}/%{name} %{_mandir}/man6/%{name}.6* %{_mandir}/pl/man6/%{name}.6* %{_datadir}/applications/%{name}.desktop %{_datadir}/appdata/%{name}.appdata.xml %{_datadir}/icons/hicolor/32x32/apps/%{name}.png %license LICENSE.txt %files data %{_datadir}/suve/%{name}/ %license LICENSE.txt %changelog * Wed Apr 12 2017 suve 1.2-7 - Use fresher upstream commit - Merge the specs for the main package and -data * Tue Apr 11 2017 suve 1.2-6 - Use desktop-file-validate for the .desktop file - Add an AppData file - Add the icon cache scriptlets * Mon Apr 10 2017 suve 1.2-5 - Use the GitHub tarball as Source0 - List the manpage and desktop file as Sources instead of putting them in Patch0 - Reduce amount of stuff put in Patch0 - Add license in the files section - Use the binary release from the site in -data Source0 - Only list the main directory in -data files listing