diff options
author | Niels Horn <niels.horn@gmail.com> | 2010-06-12 07:00:53 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-06-12 07:47:29 -0500 |
commit | 1a0d0d9b4d297bac6532832b0dcc44ea04e370f1 (patch) | |
tree | 3ac1ac0e8b3ff3d240d470711eaf1995f1a3be0f /system/lbench/lbench.SlackBuild | |
parent | 69951d47ced4595334fe939e0208bc7ae54e696b (diff) |
system/lbench: Added (system benchmark tool)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/lbench/lbench.SlackBuild')
-rw-r--r-- | system/lbench/lbench.SlackBuild | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/system/lbench/lbench.SlackBuild b/system/lbench/lbench.SlackBuild new file mode 100644 index 000000000000..6fe8ea64406b --- /dev/null +++ b/system/lbench/lbench.SlackBuild @@ -0,0 +1,82 @@ +#!/bin/sh + +# Slackware build script for lbench +# simple Linux multithread benchmarking tool + +# Written by Niels Horn <niels.horn@gmail.com> +# Revision date 2010/06/01 + +PRGNAM=lbench +VERSION=${VERSION:-1.5} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +CXXFLAGS="$SLKCFLAGS" \ +PREFIX=/usr \ +make DOCDIR=/usr/doc/$PRGNAM-$VERSION + +PREFIX=/usr \ +make install DOCDIR=/usr/doc/$PRGNAM-$VERSION DESTDIR=$PKG + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/usr/share/{applications,pixmaps} +cat desktop | \ + sed -e "s|/usr/local/bin/lbench|lbench|" \ + -e "s|/usr/local/share/lbench/icons/lbench.png|lbench|" \ + > $PKG/usr/share/applications/$PRGNAM.desktop +cp icons/$PRGNAM.png $PKG/usr/share/pixmaps/ + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |