makedeb


rotp-governor-mod-bin 4.04.0-0


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

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for rotp-governor-mod-bin.

# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
_pkgname=rotp-governor-mod
pkgname=rotp-governor-mod-bin
pkgver=4.04.0
pkgrel=0
pkgdesc="Governor mod and compressed assets of Remnants of the Precursors game."
# bundled libwebp
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
optdepends=('openjdk-17-jre')
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")
b2sums=('2db1e8a0bde6f0d2c71ea63c0bb3b9aebe78c6fef6c6d2593492990967b6a78462c2db0b972a745500cfa8775ea0bac72d5c70940061e52ac03dfbf033f9a740'
        '9299ced9dc45e8bb4b5daefb1a001f41dd99faba2be69aec960431b6a2535861cd9b26fe2d58a9e6165bad4f78a19589b6f0ee71bb655cfa8287b6c7f46ee3a4'
        '5b1958dc8ce2bf39505095b63164e1db62390224b4e250a451d28e725895005691e9b45b60142532172421789b93f38a4a6b2a22b3401b72a620ebdb9e77d5b4')
noextract=("${_pkgname}-${pkgver}-mini.jar")

prepare() {
  cd "${srcdir}"
  mkdir -p "${_pkgname}-${pkgver}"
  cd "${_pkgname}-${pkgver}"
  bsdtar -xf ../"${_pkgname}-${pkgver}-mini.jar" README.md META-INF/LICENSE
  # convert icom
  [ -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}/"

  # wrapper script
echo '#!/bin/sh

## VARIABLES
_name="rotp-governor-mod"
_LIBPREFIX="/usr/lib/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

## change to directory and launch
cd "$tmpdir"
java -jar ${_name}.jar

## cleanup
cleanup'> "$pkgdir/usr/games/${_pkgname}"
chmod 755 "$pkgdir/usr/games/${_pkgname}"

  # Desktop file
echo "[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
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[en]=Conquer the galaxy
Icon=${_pkgname}
Exec=${_pkgname}
Terminal=false
StartupNotify=false
Categories=Application;Game" > $pkgdir/usr/share/applications/${_pkgname}.desktop
}