#!/bin/sh # Heavily based on the Slackware 12.2 SlackBuild # AUTHOR: Carlo Pinciroli ####################### ### Package details ### ####################### NAME=coriander VERSION=2.0.0 ARCH=i686 BUILD=1cp SOURCE_PACKAGE=coriander-2.0.0.tar.gz SOURCE_DIRECTORY=coriander-2.0.0 ################################## ### 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 ./configure --prefix=/usr make make DESTDIR=$PKG install # Copy documentation, pixmaps and slackbuild file mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a AUTHORS COPYING ChangeLog INSTALL README TODO $PKG/usr/doc/$NAME-$VERSION cat $CWD/coriander.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/coriander.SlackBuild mkdir -p $PKG/usr/share/applications cat $CWD/coriander.desktop > $PKG/usr/share/applications/coriander.desktop ############################ ### 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 # Finally, create the package cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $TMP/$NAME-$VERSION-$ARCH-$BUILD.tgz # Optionally cleanup the working directories if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$SOURCE_PACKAGE rm -rf $PKG fi