#! /bin/sh # Heavily based on the Slackware 12.2 SlackBuild # alltray.SlackBuild created by danix # Setting up initial variables: CWD=`pwd` TMP=${TMP:-/tmp} APP=alltray VERSION=0.70 ARCH=${ARCH:-i486} BUILD=2dx PKG=$TMP/package-$APP # Setting up SLKCFLAGS if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mtune=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "x86-64" ]; then SLKCFLAGS="-O2 -fPIC" fi # Extracting Sources rm -rf $PKG mkdir -p $PKG rm -rf $TMP/$APP-$VERSION cd $TMP || exit 1 tar -zxvf "$CWD"/$APP-$VERSION.tar.gz || exit 1 cd $APP-$VERSION || exit 1 chown -R root:root . chmod -R u+w,go+r-w,a-s . # Configure and compile sources CFLAGS="$SLKCFLAGS" \ ./configure \ --mandir=/usr/man \ --disable-gconf \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux make || exit 1 make install DESTDIR=$PKG || exit 1 # Install documentation mkdir -p $PKG/usr/doc/$APP-$VERSION cp -a AUTHORS ChangeLog COPYING INSTALL NEWS README /$PKG/usr/doc/$APP-$VERSION find /$PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; cat "$CWD"/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild # Install man, *.desktop file and icon mkdir -p $PKG/usr/share/applications cp -a $APP.desktop $PKG/usr/share/applications mkdir -p $PKG/usr/share/icons cp -a $APP.png $PKG/usr/share/icons # Final tuning mkdir -p $PKG/install cat "$CWD"/slack-desc > $PKG/install/slack-desc if [ -e "$CWD"/doinst.sh.gz ]; then zcat "$CWD"/doinst.sh.gz > $PKG/install/doinst.sh fi (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 objects" | grep ELF | cut -f 1 -d : | xargs strip --strip unneeded 2> /dev/null ) if [ -d $PKG/usr/man ]; then (cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in `find . -type l` ; do ln -s $( readlink $i ).gz $i.gz; rm $i; done ) fi if [ -d $PKG/usr/info ]; then gzip -9 $PKG/usr/info/*.info rm -f $PKG/usr/info/dir fi # Building the package cd $PKG requiredbuilder -v -y -s $CWD $PKG /sbin/makepkg -l y -c n "$CWD"/$APP-$VERSION-$ARCH-$BUILD.tgz #clean up all temporary stuff if required if [ "$1" = "--cleanup" ]; then rm -rf $PKG fi