#!/bin/sh APP=gc VERSION=6.8 BUILD=gb CWD=`pwd` TARNAME=$APP$VERSION PKG=$CWD/pkg-$TARNAME ARCH=${ARCH:-i486} if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mcpu=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mcpu=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi tar xf $TARNAME.tar.gz cd $CWD/$TARNAME rm -rf $PKG mkdir $PKG cd $CWD/$TARNAME find . -perm 777 -exec chmod 755 {} \; CFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --sysconfdir=/etc make make install DESTDIR=$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 find . -perm 777 -exec chmod 755 {} \; find ./usr/man/ -iname '*.[1-6]' -exec gzip -9 {} \; find ./usr/share/man/ -iname '*.[1-6]' -exec gzip -9 {} \; ) chown -R root.bin $PKG/usr/bin mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n ../$APP-$VERSION-$ARCH-$BUILD.tgz cd $CWD rm -R $PKG rm -R $TARNAME