summaryrefslogtreecommitdiff
path: root/network/framework/framework.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'network/framework/framework.SlackBuild')
-rw-r--r--network/framework/framework.SlackBuild66
1 files changed, 43 insertions, 23 deletions
diff --git a/network/framework/framework.SlackBuild b/network/framework/framework.SlackBuild
index 11520b0cf8..7fa623f768 100644
--- a/network/framework/framework.SlackBuild
+++ b/network/framework/framework.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/sh
# Slackware build script for Metasploit Framework
-#
+
# Copyright 2009-2010 Marco Bonetti <sid77@slackware.it>
# All rights reserved.
#
@@ -23,8 +23,8 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=framework
-VERSION=${VERSION:-3.2}
-ARCH=${ARCH:-noarch}
+VERSION=${VERSION:-3.3.2}
+ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -33,38 +33,58 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+BASEINSTDIR="opt"
+INSTDIR="$BASEINSTDIR/metasploit3"
+
+if [ "$ARCH" = "i486" ]; then
+ INSTALLERARCH="i686"
+elif [ "$ARCH" = "i686" ]; then
+ INSTALLERARCH="i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ INSTALLERARCH="x86_64"
+fi
+
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
-# Install the framework in /opt
-mkdir -p $PKG/opt
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz -C $PKG/opt
-cd $PKG/opt/$PRGNAM-$VERSION
-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 {} \;
+# Unpack the installer
+sh $CWD/framework-$VERSION-linux-$INSTALLERARCH.run --noexec --keep --target $TMP/$PRGNAM-$VERSION
+
+# Install the framework under /opt/metasploit3
+( cd $TMP/$PRGNAM-$VERSION
+ mkdir -p $PKG/$INSTDIR
+ echo "Extracting the Metasploit operating environment..."
+ tar --directory=$PKG/$BASEINSTDIR -xf metasploit.tar
+ cp run.sh env.sh $PKG/$INSTDIR/
+ cp msfupdate $PKG/$INSTDIR/app/
+ echo ""
-# According to the framework user guide is ok to just link the binaries
-mkdir -p $PKG/usr/bin
-( cd $PKG/usr/bin
- for file in $(ls ../../opt/$PRGNAM-$VERSION/msf*); do
- ln -sf $file $(basename $file)
- done
-)
+ echo "Extracting the Metasploit Framework..."
+ tar --directory=$PKG/$INSTDIR -xf msf3.tar
+ echo ""
+
+ echo "Installing links into /usr/bin..."
+ mkdir -p $PKG/usr/bin
+ ( cd $PKG/usr/bin
+ for file in $(ls ../../$INSTDIR/bin/msf*); do
+ ln -sf $file $(basename $file)
+ done
+ )
+ echo ""
+) || exit 1
# Every useful doc is included inside the framework folder, just copy over the
-# README which contains the important copyright disclaimer
+# README which contains the important copyright disclaimer and the cron script
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $PKG/opt/$PRGNAM-$VERSION/README $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a $PKG/$INSTDIR/msf3/README $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/msfupdate.sh > $PKG/usr/doc/$PRGNAM-$VERSION/msfupdate.sh
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
+chown -R root:root .
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}