#!/bin/sh # by Juuso Raitala < jraitala |at| jraitala dot net > # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-calc VERSION=2.11.8.1 ARCH=i486 BUILD=1 if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mcpu=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -march=x86_64" fi if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi echo "+==============+" echo "| calc-$VERSION |" echo "+==============+" cd $TMP tar xzvf $CWD/calc-$VERSION.tar.gz cd calc-$VERSION make DEBUG="$SLKCFLAGS" \ MANDIR=/usr/man/man1 \ SCRIPTDIR=/usr/libexec/calc \ all make T=$PKG \ MANDIR=/usr/man/man1 \ SCRIPTDIR=/usr/libexec/calc \ install mkdir -p $PKG/usr/doc/calc-$VERSION cp README $PKG/usr/doc/calc-$VERSION chown -R root.root $PKG chown -R root.bin $PKG/usr/bin chmod -R u+Xrw $PKG chmod -R a+Xr $PKG ( 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 ) gzip -9 $PKG/usr/man/man1/calc.1 mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # Build the package: cd $PKG makepkg -l y -c n $TMP/calc-$VERSION-$ARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/calc-$VERSION rm -rf $PKG fi