summaryrefslogtreecommitdiff
path: root/network/arptables/arptables.SlackBuild
blob: 3b1359547bce838c4254a5b02e91c3a685cb9686 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh

# Slackware build script for arptables
# Written by Menno E. Duursma
# Modified by the SlackBuilds.org project

PRGNAM=arptables
VERSION=0.0.3
ARCH=${ARCH:-i386}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=`pwd`		
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP || exit 1
rm -rf $PRGNAM-v0.0.3-2
tar xzvf $CWD/$PRGNAM-v0.0.3-2.tar.gz || exit 1
cd $PRGNAM-v0.0.3-2 || exit 1

chown -R root:root .
chmod -R a-s,u+w,go+r-w .

mkdir -p $PKG/usr/{man,sbin}

# Don't set uid and gid of installed files in the Makefile 
# This breaks stuff for anyone who might want to test the
# script as a normal user.  We'll take care of ownership
# and permissions in the build script
cat $CWD/Makefile.diff | patch -p1 || exit 1

make || exit 1
make install PREFIX=$PKG/usr || exit 1

( cd $PKG
  find . -type f \
    | xargs file \
    | grep "executable" \
    | grep ELF | cut -f 1 -d : \
    | xargs strip --strip-unneeded \
  2> /dev/null
  find . -type f | xargs file \
    | grep "shared object" \
    | grep ELF \
    | cut -f 1 -d : \
    | xargs strip --strip-unneeded \
  2> /dev/null
)

if [ -d $PKG/usr/man ]; then
  gzip -9 $PKG/usr/man/man?/*
fi

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README
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
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz

# Clean up the extra stuff
if [ "$1" = "--cleanup" ]; then
  rm -rf $TMP/$PRGNAM-$VERSION
  rm -rf $PKG
fi