1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit user versionator
9 DESCRIPTION="An authoritative only, high performance, open source name server"
10 HOMEPAGE="http://www.nlnetlabs.nl/projects/nsd"
11 SRC_URI="http://www.nlnetlabs.nl/downloads/${PN}/${P}.tar.gz"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="bind8-stats ipv6 mmap +nsec3 root-server runtime-checks zone-stats"
29 enewuser nsd -1 -1 -1 nsd
33 # ebuild.sh sets localstatedir to /var/lib, but nsd expects /var in several locations
34 # some of these cannot be changed by arguments to econf/configure, f.i. logfile
36 --localstatedir="${EPREFIX}/var" \
37 --with-pidfile="${EPREFIX}/var/run/nsd/nsd.pid" \
38 --with-zonesdir="${EPREFIX}/var/lib/nsd" \
40 $(use_enable bind8-stats) \
44 $(use_enable root-server) \
45 $(use_enable runtime-checks checking) \
46 $(use_enable zone-stats)
50 emake DESTDIR="${D}" install
52 dodoc doc/{ChangeLog,CREDITS,NSD-FOR-BIND-USERS,README,RELNOTES,REQUIREMENTS}
54 insinto /usr/share/nsd
55 doins contrib/nsd.zones2nsd.conf
57 exeinto /etc/cron.daily
58 doexe "${FILESDIR}"/nsd.cron
60 newinitd "${FILESDIR}"/nsd.initd nsd
61 newconfd "${FILESDIR}"/nsd.confd nsd
63 # database directory, writable by nsd for ixfr.db file
65 fowners nsd:nsd /var/db/nsd
66 fperms 750 /var/db/nsd
68 # zones directory, writable by root for 'nsdc patch'
70 fowners root:nsd /var/lib/nsd
71 fperms 750 /var/lib/nsd
73 # remove /var/run data created by Makefile, handled by initd script
74 rm -r "${D}"/var/run || die "could not remove /var/run/ directory"
79 version_compare "3.2.9" "${REPLACING_VERSIONS}"
80 if test $? -eq 3; then
81 ewarn "In ${PN}-3.2.9, the database format was changed."
82 ewarn "Please run '/etc/init.d/nsd rebuild' to rebuild the database, then restart nsd."