# $Id: Portfile 76385 2011-02-21 20:58:10Z ricci@macports.org $

PortSystem 1.0
name		nessus-core
version		2.2.6
revision	0
categories	net security
maintainers	nomaintainer
description	Nessus security scanner
long_description Nessus is a security scanner that crawls across a network, looking \
		for well-known vulnerabilities and common misconfigurations.

homepage	http://www.nessus.org/
platforms	darwin
master_sites	ftp://ftp.nessus.org/pub/nessus/nessus-${version}/src/ \
		ftp://ftp.gwdg.de/pub/linux/misc/nessus/nessus-${version}/src/ \
                http://ftp.gwdg.de/pub/linux/misc/nessus/nessus-${version}/src/ \
                ftp://sunsite.cnlab-switch.ch/mirror/nessus/nessus-${version}/src/ \
                ftp://ftp.chg.ru/pub/security/nessus/nessus-${version}/src/ \
                ftp://ftp.sekure.net/pub/nessus/nessus-${version}/src/

checksums	md5 616dd7727b90df1ac978b5e736c0a960 \
		sha1 878434bbbae4f0edf9cc1c90315e2ee0524eb2e3
worksrcdir      ${name}/
depends_lib     lib:libnessus.${version}:nessus-libraries \
		lib:libnasl.${version}:libnasl	\
		port:gtk2

patchfiles	patch-nessus-preferences.c \
		patch-nessusd-preferences.c

destroot.keepdirs	${destroot}${prefix}/etc/nessus \
			${destroot}${prefix}/var/nessus/jobs \
			${destroot}${prefix}/var/nessus/logs \
			${destroot}${prefix}/var/nessus/tmp \
			${destroot}${prefix}/var/nessus/users

post-patch       {
	reinplace "s/INCLUDES_H/NESSUS_CORE_INCLUDES_H/g" ${worksrcpath}/include/includes.h
	system "mv ${worksrcpath}/include/includes.h ${worksrcpath}/include/nessus-core-includes.h"
	ui_debug "changing all includes.h to nessus-core-includes.h"
        foreach item [exec find ${worksrcpath} -type f] {
                reinplace "s/includes.h/nessus-core-includes.h/g" ${item}
        }
	ui_debug "Done changing all includes.h to nessus-core-includes.h"
	}

configure.args  --mandir=\\\${prefix}/share/man \
		--infodir=\\\${prefix}/share/info

variant no_x11 {
	configure.args-append	--disable-gtk
	depends_lib-delete	port:gtk2
}
