2012-08-13 06:02:14 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for Dungeon Crawl Stone Soup
|
|
|
|
|
|
|
|
# Written by David Melik <dchmelik @ gmail dot com>
|
|
|
|
|
|
|
|
PRGNAM=stone_soup
|
2015-09-27 22:22:41 +08:00
|
|
|
VERSION=${VERSION:-0.16.2}
|
2014-09-06 08:53:25 +08:00
|
|
|
BUILD=${BUILD:-1}
|
2012-08-13 06:02:14 +08:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -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-$VERSION
|
2013-06-06 07:45:04 +08:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION-nodeps.tar.xz
|
2012-08-13 06:02:14 +08:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 15:37:19 +08:00
|
|
|
find -L . \
|
2014-03-21 09:15:57 +08:00
|
|
|
\( -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 \
|
2014-09-02 05:05:32 +08:00
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2012-08-13 06:02:14 +08:00
|
|
|
|
|
|
|
cd source
|
2015-04-20 21:01:39 +08:00
|
|
|
make $TARGET \
|
2012-08-13 06:02:14 +08:00
|
|
|
prefix=/usr \
|
2015-04-20 21:01:39 +08:00
|
|
|
COPY_FONTS=1 \
|
2012-08-13 06:02:14 +08:00
|
|
|
DATADIR=/usr/share/games/crawl \
|
2015-04-20 21:01:39 +08:00
|
|
|
SAVEDIR=~/.crawl/ \
|
|
|
|
SDL2=1 \
|
|
|
|
TILES=1
|
|
|
|
make $TARGET install \
|
2012-08-13 06:02:14 +08:00
|
|
|
prefix=/usr \
|
2015-04-20 21:01:39 +08:00
|
|
|
COPY_FONTS=1 \
|
2012-08-13 06:02:14 +08:00
|
|
|
DATADIR=/usr/share/games/crawl \
|
2015-04-20 21:01:39 +08:00
|
|
|
DESTDIR=$PKG \
|
2012-08-13 06:02:14 +08:00
|
|
|
SAVEDIR=~/.crawl/ \
|
2015-04-20 21:01:39 +08:00
|
|
|
SDL2=1 \
|
|
|
|
TILES=1
|
|
|
|
make clean
|
|
|
|
make $TARGET \
|
|
|
|
prefix=/usr \
|
|
|
|
DATADIR=/usr/share/games/crawl \
|
|
|
|
SAVEDIR=~/.crawl/
|
|
|
|
cp crawl $PKG/usr/games/crawl-ascii
|
2012-08-13 06:02:14 +08:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
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 || true
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/man/man6
|
2012-12-17 14:43:31 +08:00
|
|
|
gzip -9 -c docs/crawl.6 > $PKG/usr/man/man6/crawl.6.gz
|
2012-08-13 06:02:14 +08:00
|
|
|
|
2015-04-20 21:01:39 +08:00
|
|
|
mkdir -p $PKG/usr/share/{applications,pixmaps}
|
|
|
|
cp $CWD/stone_soup_icon-32x32.png $PKG/usr/share/pixmaps
|
|
|
|
cp $CWD/stone_soup.desktop $PKG/usr/share/applications
|
|
|
|
|
2012-08-13 06:02:14 +08:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2013-01-01 13:40:54 +08:00
|
|
|
cp -ar $PKG/usr/share/games/crawl/docs/* $PKG/usr/doc/$PRGNAM-$VERSION
|
2014-09-02 05:05:32 +08:00
|
|
|
cp README.txt $PKG/usr/share/games/crawl/
|
2012-08-13 06:02:14 +08:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2012-12-17 14:43:31 +08:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2012-08-13 06:02:14 +08:00
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|