aboutsummaryrefslogtreecommitdiff
path: root/games/ostrichriders/ostrichriders.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/ostrichriders/ostrichriders.SlackBuild')
-rw-r--r--games/ostrichriders/ostrichriders.SlackBuild94
1 files changed, 94 insertions, 0 deletions
diff --git a/games/ostrichriders/ostrichriders.SlackBuild b/games/ostrichriders/ostrichriders.SlackBuild
new file mode 100644
index 000000000000..270a2bf5fb52
--- /dev/null
+++ b/games/ostrichriders/ostrichriders.SlackBuild
@@ -0,0 +1,94 @@
+#!/bin/sh
+
+# Slackware build script for ostrichriders
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+PRGNAM=ostrichriders
+VERSION=${VERSION:-0.6.3}
+BUILD=${BUILD:-1}
+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" = "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-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tgz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+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 {} \;
+
+# This stuff looks like it was included in the tarball by mistake.
+rm -f data/mods/sandbox/media/Thumbs.db \
+ data/mods/*/"scores (copie).dat"
+
+# SBo's SFML doesn't ship a .pc file for pkg-config, so do it the hard
+# way. Also, BINDIR and prefix are used in a nonstandard way. -Wl,-s
+# strips the binary.
+
+make prefix=$PKG \
+ BINDIR=$PKG/usr/games \
+ ADD_CFLAGS="$SLKCFLAGS" \
+ ADD_LDFLAGS="-Wl,-s \
+ -L/usr/lib$LIBDIRSUFFIX \
+ -lsfml-audio \
+ -lsfml-graphics \
+ -lsfml-system \
+ -lsfml-window \
+ $( pkg-config --libs fontconfig )" \
+ all \
+ install
+
+# Binary is named in MixedCase, symlink to lowercase for convenience.
+ln -s OstrichRiders $PKG/usr/games/$PRGNAM
+
+# man page written for this build (if nothing else, I need the practice).
+mkdir -p $PKG/usr/man/man6
+gzip -9c < $CWD/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
+ln -s $PRGNAM.6.gz $PKG/usr/man/man6/OstrichRiders.6.gz
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a LICENCE README html/* $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$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:-tgz}