#!/bin/sh # Build this against 2.6.x kernel source and headers... # Heavily based on the Slackware 12.2 SlackBuild # http://ebtables.sourcef VERSION=v2.0.8-2 ARCH=${ARCH:-i486} BUILD=${BUILD:-3lgz} ##Luci0 if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -pipe -fomit-frame-pointer" elif [ "$ARCH" = "athlon64" ]; then SLKCFLAGS="-O2 -march=athlon64 -pipe" elif [ "$ARCH" = "athlonxp" ]; then SLKCFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" fi CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp/tgz ##Luci0 fi PKG=$TMP/package-ebtables rm -rf $PKG mkdir -p $PKG mkdir -p $PKG/etc/rc.d/init.d/ebtables mkdir -p $PKG/etc/sysconfig cd $TMP rm -rf ebtables-$VERSION tar xzvf $CWD/ebtables-$VERSION.tar.gz cd ebtables-$VERSION CFLAGS="$SLKCFLAGS" \ make make install DESTDIR=$PKG \ LIBDIR=/usr/lib \ MANDIR=/usr/man \ BINDIR=/usr/sbin \ ETCDIR=/etc \ INITDIR=/etc/rc.d/init.d \ SYSCONFIGDIR=/etc/sysconfig \ || exit 1 ( 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 ) # We don't need "Red Hat-isms"... rm -Rf $PKG/etc/rc.d rm -Rf $PKG/etc/sysconfig # Compress and if needed symlink the man pages: gzip -9 $PKG/usr/man/man?/* mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/ebtables-$(echo $VERSION | cut -c 2- | tr - _)-$ARCH-$BUILD.tgz ## cleanup added Luci0 if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi