#!/bin/sh # Heavily based on the Slackware 13.0 SlackBuild # AUTHOR: Carlo Pinciroli set -e ####################### ### Package details ### ####################### NAME=globulation2 VERSION=0.9.4.4 ARCH=i686 BUILD=2cp SOURCE_PACKAGE=glob2-$VERSION.tar.gz SOURCE_DIRECTORY=glob2-$VERSION ################################## ### Create working directories ### ################################## # Current working directory CWD=`pwd` # Here we unpack the source code if ["$TMP" = ""]; then TMP=/tmp/tgz fi if [ ! -d $TMP ]; then mkdir -p $TMP fi # Here we create the slackware package PKG=$TMP/package-$NAME if [ ! -d $PKG ]; then mkdir -p $PKG fi ######################## ### We start working ### ######################## echo "| Start SlackBuild $NAME-$VERSION |" # Unpack and prepare the source code cd $TMP tar xzvf $CWD/$SOURCE_PACKAGE cd $SOURCE_DIRECTORY chown -R root:root . find . -perm 775 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; ############################## ### PACKAGE-DEPENDENT PART ### ############################## # Compile the code scons BINDIR="$PKG/usr/bin" INSTALLDIR="$PKG/usr/share" scons install # Copy documentation mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a COPYING INSTALL README README.hg $PKG/usr/doc/$NAME-$VERSION ############################ ### Finalize the package ### ############################ # Strip binaries and libraries ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Compress man and info #gzip -9 $PKG/usr/man/*/* #gzip -9 $PKG/usr/info/* # Create the package /install dir mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild # Finally, create the package cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.txz # Optionally cleanup the working directories if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$SOURCE_PACKAGE rm -rf $PKG fi