summaryrefslogtreecommitdiff
path: root/network/hping3/hping3.SlackBuild
diff options
context:
space:
mode:
authorBrenton Earl <brent@exitstatusone.com>2016-12-17 06:28:53 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-12-17 06:28:53 +0700
commit0850342043c01ee5f9301ab3344a8183b314c5b2 (patch)
treeafe48eb9e9f1e6bd49a4934d6b783c3000079ec9 /network/hping3/hping3.SlackBuild
parent343a5985432ddf620024693e2814c42bb633b925 (diff)
downloadslackbuilds-0850342043c01ee5f9301ab3344a8183b314c5b2.tar.gz
network/hping3: Switch to i586 + Add patches.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/hping3/hping3.SlackBuild')
-rw-r--r--network/hping3/hping3.SlackBuild69
1 files changed, 23 insertions, 46 deletions
diff --git a/network/hping3/hping3.SlackBuild b/network/hping3/hping3.SlackBuild
index 0dc5671a3f..10f08e77c6 100644
--- a/network/hping3/hping3.SlackBuild
+++ b/network/hping3/hping3.SlackBuild
@@ -1,11 +1,9 @@
#!/bin/sh
# Slackware build script for hping3 TCP/IP packet assembler/analyzer
-#
-# Copyright 2015 Brenton Earl <brent@exitstatusone.com>
-# All rights reserved.
-#
+
# Copyright 2009-2010 Marco Bonetti <sid77@slackware.it>
+# Copyright 2015-2016 Brenton Earl <brent@exitstatusone.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -32,7 +30,7 @@ TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -46,8 +44,8 @@ OUTPUT=${OUTPUT:-/tmp}
DOCS="APD.txt API.txt AS-BACKDOOR HPING2-HOWTO.txt HPING2-IS-OPEN HPING3.txt \
MORE-FUN-WITH-IPID SPOOFED_SCAN.txt hping2rc.example"
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -70,55 +68,34 @@ tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -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 {} \;
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Add some of Debian's patchset
-patch -p1 < $CWD/patches/libpcap0.8.diff
-patch -p1 < $CWD/patches/bytesex.diff
-patch -p1 < $CWD/patches/spelling.diff
-patch -p1 < $CWD/patches/personality.diff
-patch -p1 < $CWD/patches/tcl.diff
-patch -p1 < $CWD/patches/ip_id_field.diff
-patch -p1 < $CWD/patches/dontfrag_offbyone.diff
-patch -p1 < $CWD/patches/rtt_icmp_unreachable.diff
-patch -p1 < $CWD/patches/spelling_error_in_binary.diff
-patch -p1 < $CWD/patches/data_size_udp.diff
-patch -p1 < $CWD/patches/tcp_mss.diff
-patch -p1 < $CWD/patches/ip_optlen_conflicting_types.diff
+for i in $CWD/patches/*.diff; do
+ patch -p1 --verbose < "$i"
+done
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
-./configure \
+MANPATH=/usr/man ./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--build=$ARCH-slackware-linux
-make \
- CCOPT="$SLKCFLAGS -DUSE_TCL" \
- INSTALL_MANPATH=/usr/man
-
-# Install is done by hand, as the Makefile doesn't understand DESTDIR
-# (and it's just one file)
-install -d $PKG/usr/sbin/
-install -m 0755 hping3 $PKG/usr/sbin/
-( cd $PKG/usr/sbin
- ln -sf hping3 hping
- ln -sf hping3 hping2
-)
-install -d $PKG/usr/man/man8/
-install -m 0644 docs/hping2.8 $PKG/usr/man/man8/
-install -m 0644 docs/hping3.8 $PKG/usr/man/man8/
-
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+# From Arch Linux - Adds DESTDIR to Makefile
+patch -p1 --verbose < $CWD/patches/Makefile.patch
+
+make CCOPT="$SLKCFLAGS -DUSE_TCL"
+make install DESTDIR=$PKG
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-( 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
-)
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
( cd docs ; cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION )
@@ -128,4 +105,4 @@ 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.${PKGTYPE:-tgz}
+/sbin/makepkg -p -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}