commit d7e906857ea75ed69ccf6afe0967a4118ef11957
Author: Andrea Musuruane <musuruan(a)gmail.com>
Date: Sat May 16 10:17:34 2020 +0200
Update to v1.20
.gitignore | 1 +
SDLPoP.spec | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
prince.appdata.xml | 27 +++++++++++++++++
prince.sh | 24 +++++++++++++++
sources | 1 +
5 files changed, 140 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..948b9f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/SDLPoP-1.20.tar.gz
diff --git a/SDLPoP.spec b/SDLPoP.spec
new file mode 100644
index 0000000..d379495
--- /dev/null
+++ b/SDLPoP.spec
@@ -0,0 +1,87 @@
+Name: SDLPoP
+Version: 1.20
+Release: 1%{?dist}
+Summary: An open-source port of Prince of Persia
+
+License: GPLv3+
+URL:
https://github.com/NagyD/SDLPoP
+Source0:
https://github.com/NagyD/%{name}/archive/v%{version}/%{name}-%{version}.t...
+Source1: prince.sh
+Source2: prince.appdata.xml
+
+BuildRequires: gcc
+BuildRequires: SDL2-devel
+BuildRequires: SDL2_image-devel
+BuildRequires: SDL2_mixer-devel
+BuildRequires: desktop-file-utils
+BuildRequires: libappstream-glib
+Requires: hicolor-icon-theme
+
+%description
+SDLPoP is an open-source port of Prince of Persia, based on the disassembly
+of the DOS version.
+
+
+%prep
+%autosetup
+
+
+%build
+%set_build_flags
+%make_build -C src
+
+
+%install
+# Install wrapper
+install -d %{buildroot}%{_bindir}
+install -p -m 755 %{SOURCE1} %{buildroot}%{_bindir}/prince
+
+# Install binary
+install -d %{buildroot}%{_libexecdir}/%{name}
+install -p -m 755 prince %{buildroot}%{_libexecdir}/%{name}
+
+# Install data files
+install -d %{buildroot}%{_datadir}/%{name}
+cp -pr data mods SDLPoP.ini %{buildroot}%{_datadir}/%{name}
+
+# Install desktop file
+install -d %{buildroot}%{_datadir}/applications
+cp -p src/%{name}.desktop.template src/prince.desktop
+desktop-file-install \
+ --set-key=Exec \
+ --set-value=prince \
+ --set-icon=prince \
+ --remove-category=Application \
+ --remove-key=Path \
+ --dir %{buildroot}%{_datadir}/applications \
+ src/prince.desktop
+
+# Install icon
+install -d %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
+install -p -m 644 data/icon.png \
+ %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/prince.png
+
+# Install AppData file
+install -d %{buildroot}%{_metainfodir}
+install -p -m 644 %{SOURCE2} %{buildroot}%{_metainfodir}
+appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/prince.appdata.xml
+
+
+%files
+%{_bindir}/prince
+%{_libexecdir}/%{name}
+%{_datadir}/%{name}
+%{_datadir}/applications/prince.desktop
+%{_datadir}/icons/hicolor/*/apps/prince.png
+%{_metainfodir}/prince.appdata.xml
+%license doc/gpl-3.0.txt
+%doc doc/Readme.txt doc/ChangeLog.txt doc/bugs.txt
+
+
+%changelog
+* Sun Nov 24 2019 Andrea Musuruane <musuruan(a)gmail.com> - 1.20-1
+- Update to v1.20
+
+* Thu Aug 17 2017 Andrea Musuruane <musuruan(a)gmail.com> - 1.17-1
+- First release
+
diff --git a/prince.appdata.xml b/prince.appdata.xml
new file mode 100644
index 0000000..7bd1d53
--- /dev/null
+++ b/prince.appdata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="desktop">
+ <id>prince.desktop</id>
+ <name>SDLPoP</name>
+ <summary>An open-source port of Prince of Persia</summary>
+ <description>
+ <p>
+ SDLPoP is an open-source port of Prince of Persia, based on the disassembly
+ of the DOS version.
+ </p>
+ </description>
+ <metadata_license>CC-BY-3.0</metadata_license>
+ <project_license>GPLv3+</project_license>
+ <url
type="homepage">https://github.com/NagyD/SDLPoP/</url>
+ <screenshots>
+ <screenshot type="default">
+
<
image>https://www.popot.org/get_the_games/images/SDLPoP_1_big.png</...
+ </screenshot>
+ <screenshot>
+
<
image>https://www.popot.org/get_the_games/images/SDLPoP_2_big.png</...
+ </screenshot>
+ <screenshot>
+
<
image>https://www.popot.org/get_the_games/images/SDLPoP_3_big.png</...
+ </screenshot>
+ </screenshots>
+</component>
+
diff --git a/prince.sh b/prince.sh
new file mode 100644
index 0000000..fe74ca0
--- /dev/null
+++ b/prince.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+GAME=SDLPoP
+GAME_LOCALDIR=$HOME/.$GAME
+GAME_DATADIR=/usr/share/$GAME
+GAME_EXECUTABLE=/usr/libexec/$GAME/prince
+GAME_DOCDIR=/usr/share/doc/$GAME
+
+mkdir -p $GAME_LOCALDIR
+cd $GAME_LOCALDIR
+
+# Create link to game file
+ln -sf $GAME_EXECUTABLE
+
+# Link directories which are not modified by users
+ln -nsf ${GAME_DATADIR}/data
+
+# Copy directories which can be modified by users
+test -d mods || cp -aR ${GAME_DATADIR}/mods mods
+
+# Copy files which can be modified by users
+test -e SDLPoP.ini || cp -a $GAME_DATADIR/SDLPoP.ini .
+
+exec ./prince "$@"
+
diff --git a/sources b/sources
index e69de29..2265caf 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (SDLPoP-1.20.tar.gz) =
9adb47cd22eab553dd64678de2efb2b3d568a7352a3c277acb6ea2ce9b9b02c845b84beb9706ac7bf911ccf5689df504980008f05a14382e8f1d7cae7381b1f1