diff --git a/y/digger/digger.SlackBuild b/y/digger/digger.SlackBuild new file mode 100755 index 00000000..2b4cc001 --- /dev/null +++ b/y/digger/digger.SlackBuild @@ -0,0 +1,75 @@ +#!/bin/sh + +PRGNAM=digger +VERSION=${VERSION:-20020314} + +BUILD=${BUILD:-2} + +ARCH=$(uname -m) +LIBSUFFIX=$(echo $ARCH | grep -o "\(64\)") + +CWD=$(pwd) +TAG=cyco +TMP=${TMP:-/tmp/$TAG} +PKG=${PKG:-$TMP/pkg-$PRGNAM} +OUTPUT=${OUTPUT:-/tmp} + +PREFIX=${PREFIX:-/usr} + +# Cleaning +rm -fr $TMP/$PRGNAM-$VERSION +rm -fr $PKG + +[ ! -e $TMP/ ] && mkdir -p $TMP + +# Fetching sources +cd $TMP +[ ! -e $CWD/$PRGNAM-$VERSION.tar.?z* ] && \ + wget -c http://www.digger.org/$PRGNAM-$VERSION.tar.gz -O $CWD/$PRGNAM-$VERSION.tar.gz +tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* + +# Preparation +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Building +make -f Makefile.sdl + +# Installation +mkdir -p $PKG$PREFIX/games +cp $PRGNAM $PKG$PREFIX/games/ + +# Cleaning +cd $PKG +find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Packaging +mkdir install +cat < install/slack-desc +$PRGNAM: $PRGNAM (old-school game clone) +$PRGNAM: +$PRGNAM: From the original manual: +$PRGNAM: "Join the search for buried treasures of sparkling gold and emeralds. +$PRGNAM: With chomping front jaws, your motorized Digger Mobile puts you in the +$PRGNAM: driver's seat. Tunnel out free from mazes, outsmart the wide-eyed Nobbins +$PRGNAM: and race to collect precious gems. Count on your wits -- you'll need them!" +$PRGNAM: +$PRGNAM: +$PRGNAM: http://www.digger.org +$PRGNAM: +EOF + +makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz +