diff options
Diffstat (limited to 'network/vnstat/vnstat.SlackBuild')
-rw-r--r-- | network/vnstat/vnstat.SlackBuild | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/network/vnstat/vnstat.SlackBuild b/network/vnstat/vnstat.SlackBuild index 1c3b403d9638c..6f5e7d42fbf65 100644 --- a/network/vnstat/vnstat.SlackBuild +++ b/network/vnstat/vnstat.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for vnstat -# Copyright 2007 Michiel van Wessem (http://michielvwessem.wordpress.com) +# Copyright 2007-2009 Michiel van Wessem, Manchester, United Kingdom. # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,7 +23,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=vnstat -VERSION=${VERSION:-1.7} +VERSION=${VERSION:-1.10} ARCH=${ARCH:-i486} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -60,19 +60,24 @@ sed -i 's#install -m 644 cfg/vnstat.conf $(DESTDIR)/etc;#install -D -m 644 cfg/v # Set the compile flags in the src/Makefile properly if [ "$ARCH" = "i486" ]; then - sed -i 's#FLAGS = -O2#FLAGS = -O2 -march=i486 -mtune=i686#' \ - $TMP/$PRGNAM-$VERSION/src/Makefile + sed -i 's#FLAGS = -O2#FLAGS = -O2 -march=i486 -mtune=i686#' \ + $TMP/$PRGNAM-$VERSION/src/Makefile elif [ "$ARCH" = "i686" ]; then - sed -i 's#FLAGS = -O2#FLAGS = -O2 -march=i686 -mtune=i686#' \ - $TMP/$PRGNAM-$VERSION/src/Makefile + sed -i 's#FLAGS = -O2#FLAGS = -O2 -march=i686 -mtune=i686#' \ + $TMP/$PRGNAM-$VERSION/src/Makefile +elif [ "$ARCH" = "x86_64" ]; then + sed -i 's#FLAGS = -O2#FLAGS =-O2 -fPIC#' \ + $TMP/$PRGNAM-$VERSION/src/Makefile fi 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 . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null ) ( cd $PKG/usr/man @@ -80,18 +85,22 @@ make install DESTDIR=$PKG for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done ) -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/ -cp -a CHANGES COPYING FAQ INSTALL INSTALL_BSD README UPGRADE UNINSTALL \ - examples $PKG/usr/doc/$PRGNAM-$VERSION -cat cron/$PRGNAM > $PKG/usr/doc/$PRGNAM-$VERSION/examples/$PRGNAM.cron +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/examples +cp -a CHANGES COPYING FAQ INSTALL* README UPGRADE UNINSTALL examples \ + $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +# Remove the init.d cruft for other distros. +rm -rf $PKG/usr/doc/$PRGNAM-$VERSION/examples/init.d + +# Set up the configuration files and startup scripts. mkdir -p $PKG/etc/rc.d cat $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM.new +mv $PKG/etc/vnstat.conf $PKG/etc/vnstat.conf.new mkdir -p $PKG/install cat $CWD/doinst.sh > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |