2010-05-11 22:54:44 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Slackbuild for driftnet
|
|
|
|
# Written by JK Wood <joshuakwood@gmail.com>
|
|
|
|
|
|
|
|
PRGNAM=driftnet
|
2010-07-03 02:14:12 +02:00
|
|
|
VERSION=0.1.6_p20090401
|
|
|
|
BUILD=${BUILD:-1}
|
2010-05-11 22:54:44 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:12:38 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 22:54:44 +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:36:16 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:54:44 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:36:16 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:54:44 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:36:16 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:12:38 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:54:44 +02:00
|
|
|
fi
|
|
|
|
|
2010-07-03 02:14:12 +02:00
|
|
|
set -e
|
|
|
|
|
2010-05-11 22:54:44 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
2010-07-03 02:14:12 +02:00
|
|
|
cd $TMP
|
2010-05-11 22:54:44 +02:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-07-03 02:14:12 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-11 22:54:44 +02:00
|
|
|
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 {} \;
|
|
|
|
|
2010-07-03 02:14:12 +02:00
|
|
|
# Clean up building with libpng14 - thanks Gentoo!
|
|
|
|
sed -i -e 's:png_set_gray_1_2_4_to_8:png_set_expand_gray_1_2_4_to_8:' png.c
|
2010-05-11 22:54:44 +02:00
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
ARCH="$ARCH" \
|
2010-07-03 02:14:12 +02:00
|
|
|
make
|
2010-05-11 22:54:44 +02:00
|
|
|
|
|
|
|
# This screwy program has no make install, so we get to do things the hard way.
|
|
|
|
mkdir -p $PKG/usr/bin $PKG/usr/man/man1
|
2010-07-03 02:14:12 +02:00
|
|
|
cp -a driftnet $PKG/usr/bin
|
|
|
|
strip --strip-unneeded $PKG/usr/bin/driftnet
|
|
|
|
gzip -9c driftnet.1 > $PKG/usr/man/man1/driftnet.1.gz
|
2010-05-11 22:54:44 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a CHANGES COPYING CREDITS README TODO \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
find $PKG/usr/doc -type f -exec chmod 644 {} \;
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:36:16 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|