2010-05-11 20:01:39 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for <nload>
|
|
|
|
|
|
|
|
# Written by Michales Michaloudes korgie_earse_this_andthis@gmail.com
|
2010-05-12 17:44:00 +02:00
|
|
|
# Modified by Robby Workman <rworkman@slackbuilds.org>
|
2010-05-11 20:01:39 +02:00
|
|
|
|
|
|
|
PRGNAM=nload
|
2010-05-12 17:44:00 +02:00
|
|
|
VERSION=0.7.2
|
2010-05-11 20:01:39 +02:00
|
|
|
ARCH=${ARCH:-i486}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-12 17:44:00 +02:00
|
|
|
|
2010-05-11 20:01:39 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 00:37:36 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:01:39 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:37:36 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 17:44:00 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:37:36 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-05-11 20:01:39 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-12 17:44:00 +02:00
|
|
|
set -e # Exit on most errors
|
|
|
|
|
2010-05-11 20:01:39 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-12 17:44:00 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
2010-05-11 20:01:39 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-12 17:44:00 +02:00
|
|
|
chown -R root:root .
|
2010-05-11 20:01:39 +02:00
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2010-05-13 00:37:36 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 20:01:39 +02:00
|
|
|
--sysconfdir=/etc \
|
2010-05-12 17:44:00 +02:00
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--build=$ARCH-slackware-linux
|
2010-05-11 20:01:39 +02:00
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-05-19 08:44:41 +02:00
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-11 20:01:39 +02:00
|
|
|
|
2010-05-12 17:44:00 +02:00
|
|
|
( cd $PKG/usr/man || exit 1
|
2010-05-11 20:01:39 +02:00
|
|
|
find . -type f -exec gzip -9 {} \;
|
2010-05-12 17:44:00 +02:00
|
|
|
for i in $(find . -type l) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
2010-05-11 20:01:39 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-12 17:44:00 +02:00
|
|
|
cp -a \
|
|
|
|
AUTHORS COPYING ChangeLog NEWS README \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 20:01:39 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:37:36 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|