# $Id: Portfile,v 1.1 2005/11/18 15:41:53 mww Exp $

PortSystem 1.0

name			maradns
version			1.1.55
categories		net
platforms		darwin
maintainers		mww@opendarwin.org
description		DNS server supporting authoritative, recursive and caching DNS
long_description	MaraDNS is a fully functional DNS server supporting \
			authoritative DNS, recursive DNS, and caching DNS.

homepage		http://www.maradns.org/
master_sites	http://www.maradns.org/download/1.1/
checksums		md5 8f42f1e1de21fdd5287f58985e189a32
use_bzip2		yes

configure.pre_args

build.target

destroot.env	PREFIX=${destroot}${prefix}
destroot.destdir

post-destroot {
	xinstall -m 755 -d ${destroot}${prefix}/etc/maradns/logger
	xinstall -m 644 ${filespath}/mararc ${destroot}${prefix}/etc/maradns
	reinplace "s|__PREFIX__|${prefix}|g" ${destroot}${prefix}/etc/maradns/mararc
	file delete -force ${destroot}${prefix}/maradns-${version}
}

startupitem.create	yes
startupitem.init	\
	"PID=${prefix}/var/run/${name}.pid\nBIN=${prefix}/sbin/maradns"
startupitem.start	"\[ -x \${BIN} \] && \${BIN} &; echo \$! > \${PID}"
startupitem.stop	"\[ -r \${PID} \] && /bin/kill \$(cat \${PID})"

platform darwin 8 {
	build.args	CC="/usr/bin/gcc-4.0 -DDARWIN"
}

