Metasploit mailing list archives

Slackware 13.0 packaging issue


From: Marco Bonetti <marco.bonetti () slackware it>
Date: Thu, 26 Nov 2009 11:44:47 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello list,
I'm the framework mantainer over at SlackBuilds.org, a place where to
find SlackBuild scripts for packaging Slackware programs. I'm writing
here because I've found a strange issue when trying to package the
latest release and I'm seeking some help.
The problem is that if I install the framework using the official
installer everything is smooth while, on the other side, with my
instructions (attached to this mail) looks like the Slackware ruby 1.8
and SlackBuild.org rubygem will get in the middle, causing some troubles.
However, if I remove any installed 1.8 gems, my packaged framework
starts to work.

As you can see from the attached script I'm not doing anything much
different from the officially provided installer.sh, the only big
differences are:
+ I'm putting msf* links into /usr/bin instead of /usr/local/bin
+ I'm linking (/usr/bin/)../../opt/metasploit3/bin/msf* instead of
/opt/metasploit3/bin/msf*
Could the problems be related to relative linking? I'm pretty lost at
this point :)
Thanks in advance for any help!

ciao

- --
Marco Bonetti
Slackintosh Linux Project Developer: http://workaround.ch/
Linux-live for powerpc: http://workaround.ch/pub/rsync/mb/linux-live/

My GnuPG key id: 0x0B60BC5F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksOXB8ACgkQTYvJ9gtgvF8VSACcCwyAStQqYRNl+6NS5nCQJBle
MQ4AoNPBgE5GDZxp2PD69ib5k56H225D
=Mgbj
-----END PGP SIGNATURE-----
#!/bin/sh

# Slackware build script for Metasploit Framework
#
# 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=framework
VERSION=${VERSION:-3.3}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
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

# Unpack the installer
sh $CWD/framework-3.3-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 ""

  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/msf3/msf*); do
      ln -sf $file $(basename $file)
    done
  )
  echo ""
)

# Every useful doc is included inside the framework folder, just copy over the
# README which contains the important copyright disclaimer and the useful cron
# script
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $PKG/$INSTDIR/msf3/README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/msfupdate.cron > $PKG/usr/doc/$PRGNAM-$VERSION/msfupdate.cron
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.${PKGTYPE:-tgz}

Attachment: framework.SlackBuild.sig
Description:

_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework

Current thread: