summaryrefslogtreecommitdiff
path: root/network/nikto/nikto.SlackBuild
diff options
context:
space:
mode:
authorMarco Bonetti <sid77@slackware.it>2010-05-13 00:37:35 +0200
committerDavid Somero <xgizzmo@slackbuilds.org>2010-05-13 00:37:35 +0200
commitda7f370617e4ccdcf0c30a4000e8094a8ed03cc0 (patch)
tree0f0277c1f93951a9f6486151db30ceb7a8557813 /network/nikto/nikto.SlackBuild
parent1e683a827b6b1924402296978969b40bddb05a78 (diff)
downloadslackbuilds-da7f370617e4ccdcf0c30a4000e8094a8ed03cc0.tar.gz
network/nikto: Updated for version 2.1.1
Diffstat (limited to 'network/nikto/nikto.SlackBuild')
-rw-r--r--network/nikto/nikto.SlackBuild62
1 files changed, 47 insertions, 15 deletions
diff --git a/network/nikto/nikto.SlackBuild b/network/nikto/nikto.SlackBuild
index 07d1c45d1a..12a52624aa 100644
--- a/network/nikto/nikto.SlackBuild
+++ b/network/nikto/nikto.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for Nikto Web Scanner
#
-# Copyright 2009-2010 Marco Bonetti <sid77@slackware.it>
+# Copyright 2010-2011 Marco Bonetti <sid77@slackware.it>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,8 +23,8 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=nikto
-VERSION=${VERSION:-2.03}
-ARCH=${ARCH:-noarch}
+VERSION=${VERSION:-2.1.1}
+ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -35,9 +35,17 @@ OUTPUT=${OUTPUT:-/tmp}
DOCS="CHANGES.txt LICENSE.txt nikto_manual.html"
+if [ "$ARCH" = "i486" ]; then
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ LIBDIRSUFFIX="64"
+fi
+
# Most of the packaging techniques for this strange program comes from Debian
# rules file; next time you'll be at the pub with your friendly debianist,
-# buy him a beer ;-) - sid77
+# buy him a beer ;-)
set -e
@@ -46,20 +54,42 @@ mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
-cd $PRGNAM
+cd $PRGNAM-$VERSION
chown -R root:root .
-# Fix nmap path, remove shipped libwhisker2 dependency and more
-patch -p1 < $CWD/slackware.patch
+# Fix nikto.pl paths
+patch -p1 --verbose < $CWD/nikto.diff
+## Fix config.txt (keeping two patches a time sux, but they're simple and I
+# think that using sed here will just be worst)
+#patch -p1 --verbose < $CWD/patches/config$LIBDIRSUFFIX.diff
+# sed is better, really :-P
+sed -i -e "s:/usr/local/bin/nmap:/usr/bin/nmap:g" nikto.conf
+sed -i -e "s:# EXECDIR=/usr/local/nikto:EXECDIR=/usr/lib$LIBDIRSUFFIX/nikto:g" nikto.conf
+
+# Install the program. Revert back to nikto.pl as it looks like the official
+# name, at least OpenVAS looks for it instead of the debianized nikto ;-)
+install -d \
+ $PKG/etc/ \
+ $PKG/usr/bin/ \
+ $PKG/usr/lib$LIBDIRSUFFIX/nikto/docs/ \
+ $PKG/usr/lib$LIBDIRSUFFIX/nikto/plugins/ \
+ $PKG/usr/lib$LIBDIRSUFFIX/nikto/templates/
+install -m 0644 nikto.conf $PKG/etc/nikto.conf.new
+install -m 0644 docs/CHANGES.txt $PKG/usr/lib$LIBDIRSUFFIX/nikto/docs/
+install -m 0644 plugins/* $PKG/usr/lib$LIBDIRSUFFIX/nikto/plugins/
+install -m 0644 templates/* $PKG/usr/lib$LIBDIRSUFFIX/nikto/templates/
+install -m 0755 nikto.pl $PKG/usr/bin/
+
+## However, be compatible with any users' scripts
+# No, drop compatibility here: stick as much as possible to the sources.
+# This was a debianism I adopted with the first version, however, if you like
+# it just uncomment the lines below.
+#( cd $PKG/usr/bin
+# ln -s nikto.pl nikto
+#)
-# Install the program
-install -d $PKG/etc/nikto/ $PKG/usr/bin/ $PKG/usr/lib/nikto/plugins/
-install -m 0644 config.txt $PKG/etc/nikto/
-install -m 0644 plugins/* $PKG/usr/lib/nikto/plugins/
-install -m 0644 docs/CHANGES.txt $PKG/usr/lib/nikto/plugins/
-install -m 0755 nikto.pl $PKG/usr/bin/nikto
# Remove the shipped libwhisker2
-rm -f $PKG/usr/lib/nikto/plugins/LW2.pm
+rm -f $PKG/usr/lib$LIBDIRSUFFIX/nikto/plugins/LW2.pm
# Copy over important docs and man page
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
@@ -72,6 +102,8 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+