%global gitdate 20230430 %global gitrev 30e422c %global gitrel %{gitdate}git%{gitrev} %global comment A SDL-based port of Jordan Mechner's Prince of Persia game Name: SDLPoP Version: 1.23 Release: 1%{?gitrel:.%{gitrel}}%{?dist} Summary: %{comment} License: GPLv3 URL: https://github.com/NagyD/SDLPoP Source0: %{name}-%{version}%{?gitrel:-%{gitrel}}.tar.xz BuildRequires: SDL2_image-devel, SDL2-devel, gcc, ImageMagick Requires: SDL2_image, SDL2 %description An open-source port of Prince of Persia, based on the disassembly of the DOS version, extended with new features. %prep %autosetup -n %{name}-%{version}%{?gitrel:-%{gitrel}} %build pushd src %make_build popd %install install -m755 -d $RPM_BUILD_ROOT%{_bindir} install -m755 -d $RPM_BUILD_ROOT%{_datadir}/applications install -m755 prince $RPM_BUILD_ROOT%{_bindir}/ install -m755 -d $RPM_BUILD_ROOT%{_datadir}/%{name} cp -a data doc mods replays *.ini $RPM_BUILD_ROOT%{_datadir}/%{name}/ find $RPM_BUILD_ROOT%{_datadir}/%{name}/ -type d -exec chmod 755 {} ';' find $RPM_BUILD_ROOT%{_datadir}/%{name}/ -type f -exec chmod 644 {} ';' for side in 16 24 32 48 64 96 128 256 512; do install -m755 -d $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${side}x${side}/apps/ convert -scale ${side}x${side} data/icon.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${side}x${side}/apps/%{name}.png done cat > %{name}.desktop << EOF [Desktop Entry] Name=%{name} Comment=%{comment} Icon=%{name} Exec=%{_bindir}/prince Terminal=false Type=Application Categories=Application;Game; EOF install -m644 %{name}.desktop $RPM_BUILD_ROOT%{_datadir}/applications/ %files %license COPYING %doc README.md doc/ChangeLog.txt %{_bindir}/* %{_datadir}/applications/*.desktop %{_datadir}/icons/hicolor/*/apps/*.png %{_datadir}/%{name} %changelog * Tue Jun 20 2023 Andrea Santilli - 1.23-1.20230430git30e422c - Initial RPM release.