# $Id: Portfile,v 1.3 2006/05/27 23:08:50 markd Exp $

PortSystem	1.0

name			nagios-plugins
version			1.4.2
revision		1
categories		net
maintainers		markd@opendarwin.org
platforms		darwin

description		Nagios plugins for the Nagios host and service monitor

long_description	Nagios plugins are standalone programs that report the \
			status of hosts and services to the Nagios monitoring \
			framework.

homepage		http://nagios.org
					
master_sites		sourceforge:nagiosplug
checksums		md5 1f2bee15ade3d98ec79964a43479e328

destroot.destdir        prefix=${prefix} DESTDIR=${destroot}

depends_build		port:fping \
			port:p5-net-snmp \
			port:p5-digest-sha1 \
			port:p5-digest-hmac \
			port:p5-crypt-des

depends_lib		port:perl5.8

configure.args		--sbindir=${prefix}/share/nagios/cgi-bin \
			--libexecdir=${prefix}/libexec/nagios \
			--datadir=${prefix}/share/nagios \
			--sysconfdir=${prefix}/etc/nagios \
			--with-df-command="/bin/df -Pkt noprocfs" \
			--with-trusted-path=${prefix}/bin:${prefix}/sbin:/bin:/sbin:/usr/bin:/usr/sbin \
			--with-nagios-user=nagios \
			--with-nagios-grp=nagios \
			--with-openssl=${prefix}/bin \
			--without-mysql \
			--without-pgsql \
			--without-radius \
			--without-lmstat \
			--without-qstat \
			--without-qmail-qstat
			
platform darwin 6 { patchfiles      patch-darwinpre8-check_time.c}

platform darwin 7 {patchfiles      patch-darwinpre8-check_time.c}

variant mysql4 {
        depends_lib-append lib:libmysqlclient:mysql4
        configure.args-delete --without-mysql
        configure.args-append --with-mysql=${prefix}
}

variant qstat {
        depends_lib-append port:qstat:qstat
        configure.args-delete --without-qstat
        configure.args-append --with-qstat=${prefix}/bin
}

post-destroot {
# Put utils.pm in perl's path for certain Nagios perl plugins
	xinstall -m 755 -d ${destroot}${prefix}/lib/perl5/vendor_perl/
	system "cp ${destroot}${prefix}/libexec/nagios/utils.pm \
		${destroot}${prefix}/lib/perl5/vendor_perl/"
}
