summaryrefslogtreecommitdiffstats
path: root/network/nikto/nikto.SlackBuild
blob: 07d1c45d1a6a57c368acf2ad89bb867c5acbccf9 (plain)
#!/bin/sh

# Slackware build script for Nikto Web Scanner
#
# Copyright 2009-2010 Marco Bonetti <sid77@slackware.it>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=nikto
VERSION=${VERSION:-2.03}
ARCH=${ARCH:-noarch}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

DOCS="CHANGES.txt LICENSE.txt nikto_manual.html"

# 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

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM
chown -R root:root .

# Fix nmap path, remove shipped libwhisker2 dependency and more
patch -p1 < $CWD/slackware.patch

# 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

# Copy over important docs and man page
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKG/usr/man/man1/
( cd docs
  cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION/
  gzip -9c nikto.1 > $PKG/usr/man/man1/nikto.1.gz
)
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