2010-05-13 05:29:07 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for angband
|
|
|
|
|
|
|
|
# Written by Marshall Scott (bacchist@gmail.com)
|
2012-08-11 06:50:07 +08:00
|
|
|
# Heavily edited and currently maintained by David Melik (dchmelik@gmail.com)
|
2010-05-13 05:29:07 +08:00
|
|
|
|
|
|
|
PRGNAM=angband
|
2012-12-17 06:42:32 +08:00
|
|
|
VERSION=v3.4.1
|
2012-09-30 05:00:17 +08:00
|
|
|
BUILD=${BUILD:-3}
|
2010-05-13 05:29:07 +08:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 13:04:01 +08:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-13 05:29:07 +08:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
2010-05-13 06:25:58 +08:00
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 05:29:07 +08:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2010-05-13 06:25:58 +08:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 05:29:07 +08:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
2010-05-13 06:25:58 +08:00
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 13:04:01 +08:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 05:29:07 +08:00
|
|
|
fi
|
|
|
|
|
2012-09-30 05:00:17 +08:00
|
|
|
set -e
|
2012-08-11 06:50:07 +08:00
|
|
|
|
2010-05-13 05:29:07 +08:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
rm -rf $TMP/$PRGNAM-$VERSION
|
2012-08-11 06:50:07 +08:00
|
|
|
cd $TMP
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-13 05:29:07 +08:00
|
|
|
chown -R root:root .
|
2013-11-25 19:23:31 +08:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2010-05-13 05:29:07 +08:00
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
2012-09-17 09:44:05 +08:00
|
|
|
LDFLAGS="-lSDL" \
|
2010-05-13 05:29:07 +08:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2012-12-17 06:42:32 +08:00
|
|
|
--datarootdir=/usr/share/games \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
2010-05-13 05:29:07 +08:00
|
|
|
--bindir=/usr/games \
|
|
|
|
--with-setgid=games \
|
|
|
|
--build=$ARCH-slackware-linux \
|
|
|
|
|
2012-08-11 06:50:07 +08:00
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
2010-05-13 05:29:07 +08:00
|
|
|
|
2012-08-11 06:50:07 +08: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-13 05:29:07 +08:00
|
|
|
|
2012-08-11 06:50:07 +08:00
|
|
|
find $PKG -name "delete.me" -exec rm -f {} \;
|
2010-05-13 05:29:07 +08:00
|
|
|
|
|
|
|
for i in \
|
2012-08-11 06:50:07 +08: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 \
|
2012-12-17 06:42:32 +08:00
|
|
|
vault ;
|
2012-08-11 06:50:07 +08:00
|
|
|
do mv $PKG/etc/angband/edit/$i.txt \
|
|
|
|
$PKG/etc/angband/edit/$i.txt.new ;
|
2010-05-13 05:29:07 +08:00
|
|
|
done
|
|
|
|
|
2012-08-11 06:50:07 +08: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-13 05:29:07 +08: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 06:50:07 +08:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
2012-12-17 06:42:32 +08:00
|
|
|
rm -f $PKG/usr/doc/$PRGNAM-$VERSION/help/.dep*
|
2010-05-13 05:29:07 +08:00
|
|
|
|
|
|
|
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 06:25:58 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|