makedeb
a small tactical roguelike survival game loosely based on the Berserk manga. (wine)
Viewing /PKGBUILD
.
Click here to go back to the Git tree for berserkrl-wine.
# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
# You need to activate multiarch for wine32
# sudo dpkg --add-architecture i386
_pkgname=berserkrl
pkgname=berserkrl-wine
pkgver=0.8.5
_dlname=berserk-${pkgver}
pkgrel=1
pkgdesc="a small tactical roguelike survival game loosely based on the Berserk manga. (wine)"
arch=("all")
url="https://sourceforge.net/projects/berserkrl/"
license=("GPL3")
depends=('wine')
optdepends=('wine32: will be replaced by wow64')
extensions=()
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("https://sourceforge.net/projects/berserkrl/files/berserkrl/Berserk%21%200.8.5/berserk-0.8.5-win32.zip"
"${pkgname}.png::https://raw.githubusercontent.com/chaosforgeorg/berserkrl/refs/heads/development/install/logo512t.png")
b2sums=('d160ef50c18918b887f389c7d8dd644ed70e67396bc968a5da65f864b684bc3edf00b6ca483651bc15ca9a7653ca2c92a81f8c7a1371214c5ec5f66075e714fe'
'8c2f04e203b80306cdacc7edf409830baac8065e56e32659c15750998784910431b230b504fdbcef9939954fe8479cbe3e3b46431dbd52ac89724ae7245c785a')
prepare() {
# Warning about multiarch
printf "\33[2K\r\033[1;33m%s\033[0m" "Warning:" >&2
echo "You need to activate multiarch for wine32"
printf "\33[2K\r\033[1;33m%s\033[0m" "Warning:" >&2
echo "sudo dpkg --add-architecture i386"
# cd
cd "$srcdir/${_dlname}/"
# fix permissions
chmod 644 */* *
chmod 755 help
# Unix line terminators
sed -i 's/\r//' *.txt *.ini help/*
}
package() {
cd "$srcdir/${_dlname}"
# Creating Directories
install -dm755 $pkgdir/usr/{games,share/{games/${_pkgname},doc/${_pkgname},applications,pixmaps}}
# Install
install -Dm644 *.exe *.ini "${pkgdir}/usr/share/games/${_pkgname}"
# wrapper
echo '#!/bin/sh
set -eu
prog_name="berserkrl"
prog_real_path="/usr/share/games/berserkrl"
prog_real_doc_path="/usr/share/doc/berserkrl"
prog_home="${XDG_CONFIG_HOME:-$HOME/.config}/berserkrl/wine"
prog_bin="berserk.exe"
# home folder
mkdir -p "$prog_home"
cp -n "$prog_real_path/"berserk.ini "$prog_home"
cp -nas "$prog_real_doc_path/changelog" "$prog_home/version.txt"
[ -e "$prog_home/help" ] || ln -s "$prog_real_doc_path/help" "$prog_home/"
# cd
cd "$prog_home"
# exec
exec wineconsole "$prog_real_path/$prog_bin" "$@"' > "$pkgdir/usr/games/${_pkgname}"
chmod 755 "$pkgdir/usr/games/${_pkgname}"
# replay wrapper
echo '#!/bin/sh
exec berserkrl -play' > "$pkgdir/usr/games/${_pkgname}-replay"
chmod 755 "$pkgdir/usr/games/${_pkgname}-replay"
# doc
install -Dm644 readme.txt "$pkgdir/usr/share/doc/${_pkgname}/readme"
install -Dm644 version.txt "$pkgdir/usr/share/doc/${_pkgname}/changelog"
cp -r help "$pkgdir/usr/share/doc/${_pkgname}/help"
ln -s "/usr/share/common-licenses/GPL-3" "${pkgdir}/usr/share/doc/${_pkgname}/GPL-3"
# Deskrop file
echo "[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=${_pkgname}.png
Name=${_pkgname}
Comment=tactical roguelike survival game based on Berserk.
Exec=${_pkgname}
Categories=Application;Game;" > "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
# Icon
install -Dm644 "../${pkgname}.png" "$pkgdir/usr/share/pixmaps/${_pkgname}.png"
}