#!/bin/sh # Heavily based on the Slackware 12.1 SlackBuild # http://code.google.com/p/endgame-singularity/ # Packager : harakei - harakei84 AT gmail DOT com CWD=`pwd` TMP=${TMP:-/tmp/tgz} PKG=$TMP/package-singularity NAME=singularity VERSION=0.28a CHOST=i486 ARCH=${ARCH:-i486} BUILD=1hrk SOURCE=http://endgame-singularity.googlecode.com/files/$NAME-$VERSION-src.tar.gz MSOURCE=http://endgame-singularity.googlecode.com/files/endgame-singularity-music-006.zip if [ ! -e $CWD/$NAME-$VERSION-src.tar.gz ]; then wget -c $SOURCE || exit 1 fi if [ ! -e $CWD/endgame-singularity-music-006.zip ]; then wget -c $MSOURCE || exit 1 fi if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi cd $TMP tar xzvf $CWD/$NAME-$VERSION-src.tar.gz cd $NAME-$VERSION chown -R root:root . mkdir -p $PKG/usr/share/singularity cp -a Endgame_Linux singularity.py code data utils $PKG/usr/share/singularity mkdir -p $PKG/usr/bin cat << EOF > $PKG/usr/bin/singularity #!/bin/sh cd /usr/share/singularity ./Endgame_Linux EOF chmod 755 $PKG/usr/bin/singularity mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a AUTHORS Changelog README.txt TODO $PKG/usr/doc/$NAME-$VERSION cd $TMP unzip $CWD/endgame-singularity-music-006.zip cd endgame-singularity-music-006 cp -a music $PKG/usr/share/singularity cp -a endgame-singularity-music-README.txt $PKG/usr/doc/$NAME-$VERSION cd $PKG find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild ADD="python >= 2.5.2-i486-1,pygame >= 1.8.0-i486-2as" \ requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi