# $Id: Portfile 92837 2012-05-09 00:51:48Z ryandesign@macports.org $

PortSystem 1.0

name		nmap
version		5.51
revision	1
categories	net
maintainers	darkart.com:opendarwin.org geeklair.net:dluke
description	Port scanning utility for large networks
#license		GPL-2
# GPL-2 plus OpenSSL exception is correct, but we can't express that
# be _careful_ not to include conflicting dependents
license		Copyleft
homepage	http://nmap.org/
platforms	darwin freebsd

long_description Nmap is a utility for port scanning large networks, although \
		 it works fine for single hosts. The guiding philosophy for \
		 the creation of nmap was TMTOWTDI (There's More Than One Way \
		 To Do It). This is the Perl slogan, but it is equally \
		 applicable to scanners. Sometimes you need speed, other \
		 times you may need stealth. In some cases, bypassing \
		 firewalls may be required. Not to mention the fact that you \
		 may want to scan different protocols (UDP, TCP, ICMP, etc.). \
		 You just can't do all this with one scanning mode. And you \
		 don't want to have 10 different scanners around, all with \
		 different interfaces and capabilities.

master_sites	http://download.insecure.org/nmap/dist/ \
		ftp://nuxi.ucdavis.edu/pub/misc/

checksums           md5     0b80d2cb92ace5ebba8095a4c2850275 \
                    sha1    3415ad9a3915d7e162c9e91435cc35d9c73ac7f6 \
                    rmd160  d5ac8b245234e122936b40c80927a3c4afba53bd

depends_lib	port:libpcap \
		port:openssl \
		port:pcre \
		port:zlib

use_bzip2	yes

configure.args	--without-zenmap --without-ndiff \
		--mandir=\\\${prefix}/share/man \
		--infodir=\\\${prefix}/share/info \
		--with-openssl=${prefix} \
		--with-libpcre=${prefix} \
		--with-liblua=included

# nmap's configure script in nselib-bin does not respect --with-liblua=included
configure.env ac_cv_header_lua_h=no

use_parallel_build	no
configure.ccache	no

pre-configure {
		reinplace "s|^void main(void)|int main(void)|g" ${worksrcpath}/nbase/configure
	}

variant no_ssl	description {build without ssl support} {
			configure.args-delete --with-openssl=${prefix}
			depends_lib-delete port:openssl
		}

variant no_pcre	description {build without pcre support} {
			configure.args-delete --with-pcre=${prefix}
			depends_lib-delete port:pcre
		}

variant zenmap description {build zenmap in addition to nmap} {
			configure.args-delete --without-zenmap
			configure.python ${prefix}/bin/python2.5
			depends_lib-append port:py25-gtk
		}
