diff options
Diffstat (limited to 'system/pwgen/pwgen.SlackBuild')
-rw-r--r-- | system/pwgen/pwgen.SlackBuild | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/system/pwgen/pwgen.SlackBuild b/system/pwgen/pwgen.SlackBuild index 4ad5ec9815..ccfe396767 100644 --- a/system/pwgen/pwgen.SlackBuild +++ b/system/pwgen/pwgen.SlackBuild @@ -1,9 +1,8 @@ #!/bin/sh -# + # A slackbuild script for pwgen -# + # Copyright (c) 2007, Timothy Pollard -# # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, @@ -35,35 +34,58 @@ VERSION=2.06 ARCH=${ARCH:-i486} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} + CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$APP OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-02 -march=i486 -mtune=i486" + SLKCFLAGS="-O2 -march=i486 -mtune=i486" + LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-02 -march=i686 -mtune=i686" + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" fi +set -e + rm -rf $PKG $TMP/$APP-$VERSION mkdir -p $TMP $PKG $OUTPUT - -cd $TMP || exit 1 -tar -xzvf $CWD/$APP-$VERSION.tar.gz || exit 1 -cd $APP-$VERSION || exit 1 +cd $TMP +tar xvf $CWD/$APP-$VERSION.tar.gz +cd $APP-$VERSION chown -R root:root . chmod -R u+w,go+r-w,a-s . CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ - || exit + --build=$ARCH-slackware-linux -make || exit -make install DESTDIR=$PKG || exit +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 || true + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : \ + | xargs strip -- strip-unneeded 2> /dev/null +) + +( cd $PKG/usr/man || exit 1 + find . -type f -exec gzip -9 {} \; + for i in $( find . -type l ); do + ln -s $( readlink $i ).gz $i.gz; + rm $i; + done +) mkdir -p $PKG/usr/doc/$APP-$VERSION cp -t $PKG/usr/doc/$APP-$VERSION ChangeLog @@ -71,22 +93,7 @@ cp $CWD/$APP.SlackBuild $PKG/usr/doc/$APP-$VERSION/ find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \; mkdir -p $PKG/install -cp $CWD/slack-desc $PKG/install/ - -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 - -if [ -d $PKG/usr/man ]; then - cd $PKG/usr/man - find . -type f -exec gzip -9 {} \; - for i in $( find . -type l ); do - ln -s $( readlink $i ).gz $i.gz; - rm $i; - done -fi +cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$APP-$VERSION-$ARCH-$BUILD$TAG.tgz +/sbin/makepkg -l y -c n $OUTPUT/$APP-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |