#!/bin/sh # Heavily based on the Slackware 12.0 SlackBuild and Slacky SlackBuilds # http://www.quagga.net/ CWD=`pwd` TMP=${TMP:-/tmp/tgz} PKG=$TMP/package-quagga NAME=quagga VERSION=0.99.9 CHOST=i486 ARCH=${ARCH:-i486} BUILD=2lgz if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686" 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 if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi cd $TMP tar zxf $CWD/$NAME-$VERSION.tar.gz cd $NAME-$VERSION chown -R root:root . CFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --mandir=/usr/man \ --infodir=/usr/info \ --sysconfdir=/etc/quagga \ --localstatedir=/var/run/quagga \ --enable-vtysh \ --enable-snmp \ --enable-opaque-lsa \ --enable-ospf-te \ --enable-user=root \ --enable-group=root \ --build=$CHOST-slackware-linux make make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a AUTHORS COPYING ChangeLog INSTALL INSTALL.quagga.txt NEWS README SERVICES $PKG/usr/doc/$NAME-$VERSION # Add rc.zebra to init directory and chmod 644 mkdir -p $PKG/etc/rc.d cat $CWD/rc.zebra > $PKG/etc/rc.d/rc.zebra chmod 644 $PKG/etc/rc.d/rc.zebra ( 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 man and info pages rm $PKG/usr/info/dir gzip -9 $PKG/usr/info/quagga.info* gzip -9 $PKG/usr/man/man?/* mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/quagga-$VERSION-$ARCH-$BUILD.tgz