# Description: Authoritative only, high performance name server
# URL: http://www.nlnetlabs.nl/projects/nsd/
# Maintainer: Juergen Daubert, jue at crux dot nu
# Depends on: openssl libevent

name=nsd
version=4.12.0
release=1
source=(http://www.nlnetlabs.nl/downloads/nsd/$name-$version.tar.gz
	README pre-install nsd)

build() {
	cd $name-$version

	sed '/^dbdir/s|=.*|=/run/nsd|' -i configure.ac

	autoreconf -i
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--with-pidfile=/run/nsd/nsd.pid \
		--with-xfrdir=/run/nsd \
		--with-xfrdfile=/run/nsd/xfrd.state \
		--with-zonelistfile=/run/nsd/zone.list \
		--with-user=nsd

	make all nsd-mem
	make DESTDIR=$PKG install

	install -m 0755 nsd-mem $PKG/usr/sbin
	install -D $SRC/nsd $PKG/etc/rc.d/nsd

	rm -r $PKG/run
}
