makedeb


rotp-governor-mod-bin 4.04.0-2


Governor mod and compressed assets of Remnants of the Precursors game.

Click here to go back to the commit logs for rotp-governor-mod-bin.

Commit:


Hash: f4addd63385355306f583ced2cae7f5ec05477da

Message: refactor, drop unionfs-fuse

Diff


diff --git a/.SRCINFO b/.SRCINFO
index 968233b..8c6f714 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,11 +2,10 @@ generated-by = makedeb
 pkgname = rotp-governor-mod-bin
 pkgbase = rotp-governor-mod-bin
 pkgdesc = Governor mod and compressed assets of Remnants of the Precursors game.
-pkgrel = 1
+pkgrel = 2
 pkgver = 4.04.0
 url = https://github.com/coder111111/rotp-public
 arch = amd64
-depends = unionfs-fuse
 license = GPL3
 license = by-nc-nd4
 license = APACHE2
@@ -15,12 +14,13 @@ noextract = rotp-governor-mod-4.04.0-mini.jar
 optdepends = openjdk-17-jre
 optdepends = libcanberra-gtk-module
 source = rotp-governor-mod-4.04.0-mini.jar::https://github.com/coder111111/rotp-public/releases/download/v4.04.0/rotp-4.04.0-mini.jar
-source = https://github.com/coder111111/rotp-public/raw/master/LICENSE
-source = https://github.com/coder111111/rotp-public/raw/master/launch4j/rotp.ico
+source = https://github.com/coder111111/rotp-public/raw/refs/tags/v4.04.0/LICENSE
+source = https://github.com/coder111111/rotp-public/raw/refs/tags/v4.04.0/launch4j/rotp.ico
 b2sums = 2db1e8a0bde6f0d2c71ea63c0bb3b9aebe78c6fef6c6d2593492990967b6a78462c2db0b972a745500cfa8775ea0bac72d5c70940061e52ac03dfbf033f9a740
 b2sums = 9299ced9dc45e8bb4b5daefb1a001f41dd99faba2be69aec960431b6a2535861cd9b26fe2d58a9e6165bad4f78a19589b6f0ee71bb655cfa8287b6c7f46ee3a4
 b2sums = 5b1958dc8ce2bf39505095b63164e1db62390224b4e250a451d28e725895005691e9b45b60142532172421789b93f38a4a6b2a22b3401b72a620ebdb9e77d5b4
-bookworm_depends = openjdk-17-jre
+bookworm_optdepends = openjdk-17-jre
 makedepends = ffmpeg
 optdepends = openjdk-17-jre
 optdepends = libcanberra-gtk-module
+bookworm_optdepends = openjdk-17-jre
diff --git a/PKGBUILD b/PKGBUILD
index fb1315d..52e416d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,88 +1,70 @@
 # Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
+
 _pkgname=rotp-governor-mod
 pkgname=rotp-governor-mod-bin
 pkgver=4.04.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Governor mod and compressed assets of Remnants of the Precursors game."
-# bundled libwebp
+# bundled libwebp-imageio.so
 arch=('amd64')
 url="https://github.com/coder111111/rotp-public"
 license=('GPL3' 'by-nc-nd4' 'APACHE2')
-depends=('unionfs-fuse')
-bookworm_depends=('openjdk-17-jre')
-# at least one jre
+bookworm_optdepends=('openjdk-17-jre')
+# many jre
 optdepends=('openjdk-17-jre' 'libcanberra-gtk-module')
 makedepends=('ffmpeg')
-source=("${_pkgname}-${pkgver}-mini.jar"::"https://github.com/coder111111/rotp-public/releases/download/v${pkgver}/rotp-${pkgver}-mini.jar"
-        "https://github.com/coder111111/rotp-public/raw/master/LICENSE"
-        "https://github.com/coder111111/rotp-public/raw/master/launch4j/rotp.ico")
+source=("${_pkgname}-${pkgver}-mini.jar::https://github.com/coder111111/rotp-public/releases/download/v${pkgver}/rotp-${pkgver}-mini.jar"
+        "https://github.com/coder111111/rotp-public/raw/refs/tags/v${pkgver}/LICENSE"
+        "https://github.com/coder111111/rotp-public/raw/refs/tags/v${pkgver}/launch4j/rotp.ico")
 b2sums=('2db1e8a0bde6f0d2c71ea63c0bb3b9aebe78c6fef6c6d2593492990967b6a78462c2db0b972a745500cfa8775ea0bac72d5c70940061e52ac03dfbf033f9a740'
         '9299ced9dc45e8bb4b5daefb1a001f41dd99faba2be69aec960431b6a2535861cd9b26fe2d58a9e6165bad4f78a19589b6f0ee71bb655cfa8287b6c7f46ee3a4'
         '5b1958dc8ce2bf39505095b63164e1db62390224b4e250a451d28e725895005691e9b45b60142532172421789b93f38a4a6b2a22b3401b72a620ebdb9e77d5b4')
 noextract=("${_pkgname}-${pkgver}-mini.jar")
+extensions=()
 
 prepare() {
   cd "${srcdir}"
+  # extract
   mkdir -p "${_pkgname}-${pkgver}"
-  cd "${_pkgname}-${pkgver}"
-  bsdtar -xf ../"${_pkgname}-${pkgver}-mini.jar" README.md META-INF/LICENSE
+  bsdtar -xf "${_pkgname}-${pkgver}-mini.jar" -C "${_pkgname}-${pkgver}"
+  # rm junk
+  rm -Rf "${_pkgname}-${pkgver}/native/"{mac,win}
   # convert icom
-  [ -e "${_pkgname}.png" ] || ffmpeg -i "../rotp.ico"  "${_pkgname}.png"
+  [ -e "${_pkgname}.png" ] || ffmpeg -i rotp.ico  "${_pkgname}.png"
 }
 
-package() {
-  cd "$srcdir"
-  # Create directories
-  install -m755 -d $pkgdir/usr/{games,share/applications}
-  # install
-  install -Dm644 "${_pkgname}-${pkgver}-mini.jar" "$pkgdir/usr/lib/games/${_pkgname}/${_pkgname}.jar"
-  install -Dm644 "${_pkgname}-${pkgver}/${_pkgname}.png" "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
-  # doc
-  install -Dm644 "${_pkgname}-${pkgver}/README.md" "$pkgdir/usr/share/doc/${_pkgname}/readme"
-  install -Dm644 "${_pkgname}-${pkgver}/META-INF/LICENSE" "$pkgdir/usr/share/doc/${_pkgname}/LICENSE-jackson"
-  install -Dm644 "LICENSE" "$pkgdir/usr/share/doc/${_pkgname}/"
-  ln -s /usr/share/common-licenses/Apache-2.0 "$pkgdir/usr/share/doc/${_pkgname}/"
+build() {
+  cd "${srcdir}"
+  # hicolor icons
+  _resolutions=(96 64 48 32 16)
+  for _res in "${_resolutions[@]}"; do
+    mkdir -p "hicolor/${_res}x${_res}/apps"
+    ffmpeg -y -i "${_pkgname}.png" -vf scale="${_res}:${_res}" "hicolor/${_res}x${_res}/apps/${_pkgname}.png"
+  done
+  # WRAPPER
+  export _WRAPPER='#!/bin/sh
 
-  # wrapper script
-echo '#!/bin/sh
+set -eu
 
 ## VARIABLES
 _name="rotp-governor-mod"
 _LIBPREFIX="/usr/lib/games/${_name}"
+_SHAREPREFIX="/usr/share/games/${_name}"
 config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/$_name"
-if [ -n "$XDG_RUNTIME_DIR" ]; then
-   tmpdir=$XDG_RUNTIME_DIR/${_name}
-else
-   tmpdir=/tmp/$USER/${_name}
-fi
-
-## CLEANUP
-cleanup()
-{
-  echo "Cleaning"
-  fusermount -qzu "$tmpdir"
-  rm -Rf "$tmpdir"
-}
-
-trap cleanup 1 2 3 6 15
 
-## Create directories
-mkdir -p "$tmpdir"
-mkdir -p "$config_dir"
-
-## mount
-unionfs -o cow -o umask=000 $config_dir=RW:${_LIBPREFIX}=RO "$tmpdir" || exit 1
+# Home directory
+mkdir -p "$config_dir/opt"
+for _file in $(ls "${_SHAREPREFIX}") ; do
+  [ -e "$config_dir/opt/$_file" ] || ln -s "${_SHAREPREFIX}/$_file"  "$config_dir/opt"
+done
+[ -e "$config_dir/opt/native" ] || ln -s "${_LIBPREFIX}/native" "$config_dir/opt"
 
 ## change to directory and launch
-cd "$tmpdir"
-java -jar ${_name}.jar
-
-## cleanup
-cleanup'> "$pkgdir/usr/games/${_pkgname}"
-chmod 755 "$pkgdir/usr/games/${_pkgname}"
+cd "$config_dir/opt"
+exec java rotp.Rotp "$@"'
 
   # Desktop file
-echo "[Desktop Entry]
+  export _DESKTOPFILE="[Desktop Entry]
 Type=Application
 Version=1.0
 Encoding=UTF-8
@@ -90,11 +72,33 @@ Name=Remnants of the Precursors (governor mod)
 Name[en]=Remnants of the Precursors (governor mod)
 GenericName=A Master of Orion clone
 GenericName[en]=A Master of Orion clone
-Comment=Conquer the galaxy 
+Comment=Conquer the galaxy
 Comment[en]=Conquer the galaxy
 Icon=${_pkgname}
 Exec=${_pkgname}
 Terminal=false
 StartupNotify=false
-Categories=Application;Game" > $pkgdir/usr/share/applications/${_pkgname}.desktop
+Categories=Application;Game"
+
+}
+
+package() {
+  cd "$srcdir"
+  # Create directories
+  install -m755 -d $pkgdir/usr/{games,"lib/games/${_pkgname}",share/{applications,games,doc/${_pkgname}}}
+  # install
+  cp -R "${_pkgname}-${pkgver}" "$pkgdir/usr/share/games/${_pkgname}"
+  mv "$pkgdir/usr/share/games/${_pkgname}/native" "$pkgdir/usr/lib/games/${_pkgname}/"
+  install -Dm644 "${_pkgname}.png" "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
+  # doc
+  install -Dm644 "LICENSE" "$pkgdir/usr/share/doc/${_pkgname}/"
+  ln -s "/usr/share/games/${_pkgname}/README.md" "$pkgdir/usr/share/doc/${_pkgname}/readme"
+  ln -s "/usr/share/games/${_pkgname}/META-INF/LICENSE" "$pkgdir/usr/share/doc/${_pkgname}/LICENSE-jackson"
+  ln -s /usr/share/common-licenses/Apache-2.0 "$pkgdir/usr/share/doc/${_pkgname}/"
+  # Wrapper
+  echo "$_WRAPPER" > "$pkgdir/usr/games/${_pkgname}"
+  chmod 755 "$pkgdir/usr/games/${_pkgname}"
+  # Icons and desktop file
+  echo "$_DESKTOPFILE" > $pkgdir/usr/share/applications/${_pkgname}.desktop
+  cp -R "${srcdir}/hicolor" "${pkgdir}/usr/share/icons/"
 }