#!/bin/sh # # Heavily based on the Slackware 13.0 SlackBuild # http://clpbar.sourceforge.net/ # # Bar is a simple tool to copy a stream of data and print a # display for the user on stderr showing # (a) the amount of data passed, # (b) the throughput of the data transfer, and # (c) the transfer time, or, if the total size of the data # stream is known, the estimated time remaining, what # percentage of the data transfer has been completed, # and a progress bar. # Bar was originally written for the purpose of estimating # the amount of time needed to transfer large amounts # (many, many gigabytes) of data across a network. # (Usually in an SSH/tar pipe.) # # SlackBuild from Matteo Rossini (zerouno @ slacky.it) CWD=`pwd` NAME=bar TMP=${TMP:-/tmp/txz} PKG=$TMP/package-$NAME VERSION=1.10.9 ARCH=${ARCH:-i486} BUILD=1mt SOURCE=http://downloads.sourceforge.net/project/clpbar/clpbar/$NAME-$VERSION/${NAME}_$VERSION.tar.gz if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" CHOST=x86_64 fi [ ! -e ${NAME}_$VERSION.tar.gz ]&&wget $SOURCE [ -d $TMP/$NAME-$VERSION ]&&rm -rf $TMP/$NAME-$VERSION mkdir -p $TMP [ -d $PKG ]&&rm -rf $PKG mkdir -p $PKG cd $TMP tar xzvf $CWD/${NAME}_$VERSION.tar.gz cd $NAME-$VERSION find . \( -perm 777 -o -perm 775 -o -perm 711 \) -exec chmod 755 {} \; find . \( -perm 700 -o -perm 555 -o -perm 511 \) -exec chmod 755 {} \; find . \( -perm 666 -o -perm 664 -o -perm 600 \) -exec chmod 644 {} \; find . \( -perm 444 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; chown -R root:root . CFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr make || exit 1 make install DESTDIR=$PKG || exit 1 mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in TODO TROUBLESHOOTING $PKG/usr/doc/$NAME-$VERSION cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild mv $PKG/usr/share/man $PKG/usr rmdir $PKG/usr/share find $PKG/usr/man -type f -exec gzip -9 {} \; requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.txz if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$NAME-$VERSION $PKG fi