# $Id$

PortSystem 1.0

name		nmap
version		7.31
categories	net
maintainers	darkart.com:opendarwin.org geeklair.net:dluke
description	Port scanning utility for large networks
license		{GPL-2 OpenSSLException}
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	f2f6660142a777862342a58cc54258ea \
		sha1	9dcfc5bf599a4fe53ca9bfc53b1b9a2741bf1c6c \
		rmd160	4d472089814057ee9e57fb1801a6eac91730a17c \
		sha256	cb9f4e03c0771c709cd47dc8fc6ac3421eadbdd313f0aae52276829290583842

depends_lib	port:libpcap \
		port:zlib \
		port:apr \

use_bzip2	yes

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

# nmap's configure script in nselib-bin does not respect --with-liblua=included
# as with many ports, configure fails if nawk is installed, force use of system awk
configure.env ac_cv_header_lua_h=no ac_cv_prog_AWK=awk

use_parallel_build	no
configure.ccache	no

#- add back +ssl and +pcre once we remove the compatibility variants
default_variants +subversion

variant ssl description {build with ssl support} {
			configure.args-append --with-openssl=${prefix}
			depends_lib-append path:lib/libssl.dylib:openssl
		}

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

variant subversion description {build with subversion (nmap-update) support} {
			configure.args-delete --without-subversion
			depends_lib-append port:subversion
		}

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

#- remove after March 2017, backwards compatibility for previous variants
variant no_ssl description {Legacy compatibility variant} {}
if {![variant_isset no_ssl]} {
	default_variants +ssl
}
variant no_pcre description {Legacy compatibility variant} {}
if {![variant_isset no_pcre]} {
	default_variants +pcre
}