%global git_date 20171018 %global git_commit 227c86f02f2131381a597358d9d92eec56383f8c Name: waaaa Version: %{git_date} Release: 4%{?dist} Summary: Put the ball in the basket with the power of your voice License: GPLv3 URL: https://github.com/dos1/%{name} Source0: %{URL}/archive/%{git_commit}/%{name}-%{git_commit}.tar.gz # The game ships with a bundled copy of libsuperderpy. # This patch allows building with a system-provided copy of the library. Patch0: %{name}-unbundle-libsuperderpy.patch BuildRequires: allegro5-devel BuildRequires: allegro5-addon-acodec-devel BuildRequires: allegro5-addon-audio-devel BuildRequires: allegro5-addon-image-devel BuildRequires: allegro5-addon-ttf-devel BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: fftw-devel BuildRequires: libsuperderpy-devel Requires: %{name}-data = %{version}-%{release} Requires: dejavu-sans-mono-fonts Requires: hicolor-icon-theme Requires: zehfernando-perfect-dos-vga-437-font %description A two-player game where both of you scream into the microphone, trying to land the ball in the other player's basket. The floor reacts to the volume of your shouts, flinging the ball high into the air. %package data Summary: Data files required to play %{name} BuildArch: noarch %description data Data files (graphics, sounds, etc.) required to play %{name}. %prep %setup -q -n %{name}-%{git_commit} %patch0 -p1 %build mkdir build cd build cmake .. -DCMAKE_C_FLAGS="-ggdb" -DCMAKE_INSTALL_PREFIX=%{_prefix} make DESTDIR=%{buildroot} %{?_smp_mflags} %install install -m 755 -d %{buildroot}%{_bindir} ln -s %{_libdir}/%{name}/%{name} %{buildroot}/%{_bindir}/%{name} install -m 755 -d %{buildroot}%{_libdir}/%{name}/ install -m 755 build/src/%{name} %{buildroot}%{_libdir}/%{name}/ install -m 755 build/src/*.so %{buildroot}%{_libdir}/%{name}/ install -m 755 -d %{buildroot}%{_libdir}/%{name}/gamestates install -m 755 build/src/gamestates/*.so %{buildroot}%{_libdir}/%{name}/gamestates/ # The game expects to find its assets in a "data/" directory. # Make a symlink to the data directory in /usr/share. ln -s %{_datadir}/%{name}/ %{buildroot}%{_libdir}/%{name}/data # First, copy the entire data dir install -m 755 -d %{buildroot}%{_datadir}/ cp -a data %{buildroot}%{_datadir}/%{name} # Then remove files that we do not need rm %{buildroot}%{_datadir}/%{name}/%{name}.desktop rm -rf %{buildroot}%{_datadir}/%{name}/icons/* find %{buildroot}%{_datadir}/%{name} -name 'CMakeLists.txt' -exec rm '{}' ';' for SIZE in 16 32 48 64 128 256 512 1024; do install -m 755 -d %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps/ install -m 644 -p \ data/icons/$SIZE/%{name}.png \ %{buildroot}%{_datadir}/icons/hicolor/${SIZE}x${SIZE}/apps/%{name}.png done cp -a data/icons/%{name}.png %{buildroot}%{_datadir}/%{name}/icons/ install -m 755 -d %{buildroot}%{_datadir}/applications desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications \ data/%{name}.desktop # Remove bundled fonts, replace with symlinks to system fonts rm %{buildroot}%{_datadir}/%{name}/fonts/DejaVuSansMono.ttf ln -s \ %{_datadir}/fonts/dejavu/DejaVuSansMono.ttf \ %{buildroot}%{_datadir}/%{name}/fonts/DejaVuSansMono.ttf rm %{buildroot}%{_datadir}/%{name}/fonts/PerfectDOSVGA437.ttf ln -s \ %{_datadir}/fonts/zehfernando/Perfect-DOS-VGA-437.ttf \ %{buildroot}%{_datadir}/%{name}/fonts/PerfectDOSVGA437.ttf %files %license COPYING %{_bindir}/%{name} %{_libdir}/%{name} %{_datadir}/applications/* %files data %license COPYING %{_datadir}/%{name} %{_datadir}/icons/hicolor/*/apps/* %changelog * Sat Jan 20 2018 Iwicki Artur 20171018-4 - Move the executable and gamestate objects from /usr/share to /usr/lib - Remove icon-cache related scriplets * Wed Nov 29 2017 Iwicki Artur 20171018-3 - Add missing build-time dependencies - Add "generate debuginfo" compiler flags * Mon Nov 27 2017 Iwicki Artur 20171018-2 - Move "Perfect DOS VGA 437" font to separate package - Update icon cache after (un)installing * Sat Nov 25 2017 Iwicki Artur 20171018-1 - Initial packaging