slackbuilds/y/My_Dystopian_Robot_Girlfriend/SlackBuild

74 lines
2.1 KiB
Text
Raw Permalink Normal View History

#!/bin/bash
CWD=$(pwd)
TAG=${TAG:-gwh}
OUTPUT=${OUTPUT:-/tmp}
TMP=/tmp/$TAG
PRGNAM=$(basename $CWD)
VERSION=${VERSION:-$(echo MDRG*.zip | grep -o "[0-9.]*" | head -n1)}
ARCH=${ARCH:-$(uname -m)}
2024-02-06 08:22:28 +01:00
BUILD=${BUILD:-12}
PKG=$TMP/pkg-$PRGNAM
[ ! -e $CWD/MDRG$VERSION\ -\ Linux.zip ] && exit 1
rm -rf $PKG
mkdir -p $TMP
cd $TMP
mkdir -p $PKG/opt/
2024-02-06 08:22:28 +01:00
unzip -d $PKG/opt/$PRGNAM/ $CWD/MDRG$VERSION\ -\ Linux.zip
#mv $PKG/opt/MDRG$VERSION\ -\ Linux $PKG/opt/$PRGNAM
chmod +x $PKG/opt/$PRGNAM/My\ Dystopian\ Robot\ Girlfriend.x86_64
mkdir -p $PKG/opt/$PRGNAM/My\ Dystopian\ Robot\ Girlfriend_Data/Saves/
mkdir -p $PKG/opt/$PRGNAM/My\ Dystopian\ Robot\ Girlfriend_Data/Mods/
mkdir -p $PKG/usr/games/
cat <<EOF > $PKG/usr/games/$PRGNAM
#!/bin/bash
cd /opt/$PRGNAM/
./My\ Dystopian\ Robot\ Girlfriend.x86_64
EOF
chmod +x $PKG/usr/games/$PRGNAM
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
${PRGNAM}: ${PRGNAM} (NSFW game)
${PRGNAM}:
${PRGNAM}:
${PRGNAM}:
${PRGNAM}:
${PRGNAM}:
${PRGNAM}:
${PRGNAM}: (You need to download the game and put the file MDRGx.x.x\ -\ Linux.zip
${PRGNAM}: and put it next to this script)
${PRGNAM}:
${PRGNAM}: https://incontinentcell.itch.io/factorial-omega
EOF
cd $PKG || exit 1
chown -R root:root *
chown -R root:games $PKG/opt/$PRGNAM/
chmod -R g+w $PKG/opt/$PRGNAM/
chmod g+w $PKG/opt/My_Dystopian_Robot_Girlfriend/ \
$PKG/opt/My_Dystopian_Robot_Girlfriend/My\ Dystopian\ Robot\ Girlfriend_Data/Saves/ \
$PKG/opt/My_Dystopian_Robot_Girlfriend/My\ Dystopian\ Robot\ Girlfriend_Data/Mods/
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}$TAG.txz