# $Id: Portfile,v 1.1 2006/05/21 06:02:26 ricci Exp $

PortSystem 1.0
name		metasploit2
version		2.5
revision	0
categories	security
maintainers	opendarwin.org@darkart.com
description	its metasploit...
homepage	http://metasploit.com/
platforms	darwin

long_description A framework for, ahem, testing software.

master_sites	http://www.metasploit.com/tools/

distfiles	framework-${version}.tar.gz
worksrcdir	framework-${version}

checksums	md5 af317c1c673a1ce4523c6fa7b651e1c5 \
		sha1 16d2d3efb2c3930b95913693f01ebf35653fe737

depends_lib	port:perl5.8 \
		port:p5-term-readline-gnu \
		port:p5-net-ssleay

configure       {}
build           {
			foreach file [glob -directory ${worksrcpath} msf*] {
				reinplace "s|#!/usr/bin/perl|#!${prefix}/bin/perl|" $file
			}
		}
destroot        { 
			set metasploitTargetDir "libexec/metasploit2"
			xinstall -d -m 755 ${destroot}/${prefix}/${metasploitTargetDir}
			foreach file [glob -directory ${workpath}/${worksrcdir} *]  {
				file copy ${file} ${destroot}/${prefix}/${metasploitTargetDir}
			}
			cd ${destroot}/${prefix}/sbin
			foreach file [glob -directory ${destroot}/${prefix}/${metasploitTargetDir} msf*]  {
				set useFile [file tail ${file}]
## 'file link' doesn't play nice, it doesn't (seem) to want to do relative paths...
##				file link -symbolic ${useFile} ../${metasploitTargetDir}/${useFile}
## so use 'system "ln -s ..."' instead.
				system "ln -s ../${metasploitTargetDir}/${useFile} ${useFile}"
			}
		 }



#
##EOF
