# $Id: Portfile 51975 2009-06-07 19:03:36Z pmq@macports.org $

PortSystem 1.0

name               medusa
version            1.5
categories         security net
platforms          darwin
maintainers        pmq openmaintainer

description        Medusa is a speedy, massively parallel, modular, login brute-forcer
long_description   Medusa is intended to be a speedy, massively parallel, \
		   modular, login brute-forcer. The goal is to support as \
		   many services which allow remote authentication as possible. \
		   The author considers following items as some of the key \
		   features of this application. Thread-based parallel testing: \
		   Brute-force testing can be performed against multiple hosts, \
		   users or passwords concurrently. Flexible user input: Target \
		   information (host/user/password) can be specified in a variety \
		   of ways. For example, each item can be either a single entry \
		   or a file containing multiple entries. Additionally, a \
		   combination file format allows the user to refine their target \
		   listing. Modular design: Each service module exists as an \
		   independent .mod file. This means that no modifications are \
		   necessary to the core application in order to extend the \
		   supported list of services for brute-forcing.

homepage           http://www.foofus.net/jmk/medusa/medusa.html
master_sites       http://www.foofus.net/jmk/tools freebsd:
checksums          md5 11e04f6ac4bf559d5a0c6861a1cb8604 \
		   sha1 6a4a44584be1c672b8f9528582c5a2fc82faade8

depends_lib        port:openssl port:libssh2

livecheck.check	   regex
livecheck.url      ${homepage}
livecheck.regex	   "${name}-(.*?).tar.gz"

patch {
    # not very tasteful and doesn't fully work
    reinplace "s|/usr/local|${prefix}|" ${worksrcpath}/configure
}

# --enable-untested
# hopefully the mod-path will be superfluous next release
configure.args     --with-default-mod-path=${prefix}/lib/medusa/modules \
                   --enable-module-svn=no \
                   --enable-module-postgres=no

variant subversion description "Build the Subversion module" {
    # the apr-* detection is problematic
    # configure.cppflags   "-I${prefix}/include/subversion-1 -I${prefix}/include/apr-0"
    configure.args-delete --enable-module-svn=no
    configure.args-append --enable-module-svn=yes
    depends_lib-append port:subversion
}

variant postgresql description "Build the PostgreSQL module" {
    configure.args-delete --enable-module-postgres=no
    configure.args-append --enable-module-postgres=yes
    depends_lib-append port:postgresql83
}

# FIXME check building afpfs-ng, ncp
