2010-05-12 23:29:07 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for angband
|
|
|
|
|
|
|
|
# Written by Marshall Scott (bacchist@gmail.com)
|
2012-08-11 00:50:07 +02:00
|
|
|
# Heavily edited and currently maintained by David Melik (dchmelik@gmail.com)
|
2010-05-12 23:29:07 +02:00
|
|
|
|
|
|
|
PRGNAM=angband
|
2012-08-11 00:50:07 +02:00
|
|
|
VERSION=v3.3.2
|
2012-09-17 03:44:05 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2010-05-12 23:29:07 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:04:01 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-12 23:29:07 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
2010-05-13 00:25:58 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:07 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2010-05-13 00:25:58 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:07 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
2010-05-13 00:25:58 +02:00
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:04:01 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:07 +02:00
|
|
|
fi
|
|
|
|
|
2012-08-11 00:50:07 +02:00
|
|
|
set -e # Exit on most errors
|
|
|
|
|
2010-05-12 23:29:07 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
rm -rf $TMP/$PRGNAM-$VERSION
|
2012-08-11 00:50:07 +02:00
|
|
|
cd $TMP
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-12 23:29:07 +02:00
|
|
|
chown -R root:root .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
|
|
|
# --enable-gtk and setgid are incompatible, so we'll not build the gtk part
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
2012-09-17 03:44:05 +02:00
|
|
|
LDFLAGS="-lSDL" \
|
2010-05-12 23:29:07 +02:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--with-libpath=/usr/share/games/angband \
|
2012-08-11 00:50:07 +02:00
|
|
|
--with-configpath=/etc/angband \
|
|
|
|
--with-varpath=/var/games/angband \
|
2010-05-12 23:29:07 +02:00
|
|
|
--bindir=/usr/games \
|
|
|
|
--with-setgid=games \
|
|
|
|
--build=$ARCH-slackware-linux \
|
|
|
|
|
2012-08-11 00:50:07 +02:00
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
2010-05-12 23:29:07 +02:00
|
|
|
|
2012-08-11 00:50:07 +02:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
2010-05-12 23:29:07 +02:00
|
|
|
|
|
|
|
# We'll kill the "delete.me" files in the package; probably these are left so
|
|
|
|
# that lesser package management tools don't choke on empty directories
|
2012-08-11 00:50:07 +02:00
|
|
|
find $PKG -name "delete.me" -exec rm -f {} \;
|
2010-05-12 23:29:07 +02:00
|
|
|
|
|
|
|
# Now let's prevent upgrades from clobbering any existing datafiles
|
|
|
|
# We'll handle these in doinst.sh
|
|
|
|
for i in \
|
2012-08-11 00:50:07 +02:00
|
|
|
artifact ego_item flavor hints limits monster monster_base names object \
|
|
|
|
object_base p_class p_hist p_race pain pit shop_own spell store terrain \
|
|
|
|
vault ;
|
|
|
|
do mv $PKG/etc/angband/edit/$i.txt \
|
|
|
|
$PKG/etc/angband/edit/$i.txt.new ;
|
2010-05-12 23:29:07 +02:00
|
|
|
done
|
|
|
|
|
2012-08-11 00:50:07 +02:00
|
|
|
mkdir -p $PKG/usr/share/{applications,pixmaps}
|
|
|
|
cp $CWD/angband.png $PKG/usr/share/pixmaps
|
|
|
|
cp $CWD/angband.desktop $PKG/usr/share/applications
|
|
|
|
|
2010-05-12 23:29:07 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
|
|
|
changes.txt copying.txt faq.txt readme.txt thanks.txt lib/help/ \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
|
2012-08-11 00:50:07 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
2010-05-12 23:29:07 +02:00
|
|
|
rm -f $PKG/usr/doc/$PRGNAM-$VERSION/help/.depend*
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:25:58 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|