slackbuilds_ponce/games/zork-mit/zork-mit.SlackBuild
B. Watson 268f20a2c8
games/zork-mit: Added (PDP/10 Zork from MIT, circa 1981)
Signed-off-by: bedlam <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2023-04-08 09:16:25 +07:00

101 lines
2.6 KiB
Bash

#!/bin/bash
# Slackware build script for zork-mit
# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=zork-mit
VERSION=${VERSION:-1.1.2+20220404_cc4406e}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-v$VERSION
tar xvf $CWD/$PRGNAM-v$VERSION.tar.xz
cd $PRGNAM-v$VERSION
chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# No way to override cleanly, so:
sed -i "/^CFLAGS/s,-Os,$SLKCFLAGS,g" */makefile
# Fugly, but this works:
make BOOSTLIB="-lboost_program_options \
-lboost_serialization \
-lboost_filesystem \
-lboost_system"
install -s -D -m0755 -oroot -groot mdlfun/zork_linux $PKG/usr/games/$PRGNAM
# Icons made by combining a color-shifted version of the MIT logo
# with the Zork icons. The result isn't very pretty, but at least
# it's distinctive. If you can make better icons, please do, I'll
# include them here.
for i in 32 48 64; do
size=${i}x${i}
dir=$PKG/usr/share/icons/hicolor/$size/apps
mkdir -p $dir
cat $CWD/icons/$i.png > $dir/$PRGNAM.png
done
mkdir -p $PKG/usr/share/pixmaps
ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
# .desktop file made by SlackBuild author.
mkdir -p $PKG/usr/share/applications
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
# As fascinating as it is, don't include the MDL programmer's manual
# (MIT-LCS-TR-292.pdf) in the package. It's large and not useful for
# players...
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a README* dungeon-1981.jpg $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE