1 # Copyright 1999-2013 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 minimal-responses mmap +nsec3 ratelimit 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) \
42 $(use_enable minimal-responses) \
45 $(use_enable ratelimit) \
46 $(use_enable root-server) \
47 $(use_enable runtime-checks checking) \
48 $(use_enable zone-stats)
52 emake DESTDIR="${D}" install
54 dodoc doc/{ChangeLog,CREDITS,NSD-FOR-BIND-USERS,README,RELNOTES,REQUIREMENTS}
56 insinto /usr/share/nsd
57 doins contrib/nsd.zones2nsd.conf
59 exeinto /etc/cron.daily
60 doexe "${FILESDIR}"/nsd.cron
62 newinitd "${FILESDIR}"/nsd.initd nsd
63 newconfd "${FILESDIR}"/nsd.confd nsd
65 # database directory, writable by nsd for ixfr.db file
67 fowners nsd:nsd /var/db/nsd
68 fperms 750 /var/db/nsd
70 # zones directory, writable by root for 'nsdc patch'
72 fowners root:nsd /var/lib/nsd
73 fperms 750 /var/lib/nsd
75 # remove /var/run data created by Makefile, handled by initd script
76 rm -r "${D}"/var/run || die "could not remove /var/run/ directory"
81 version_compare "3.2.9" "${REPLACING_VERSIONS}"
82 if test $? -eq 3; then
83 ewarn "In ${PN}-3.2.9, the database format was changed."
84 ewarn "Please run '/etc/init.d/nsd rebuild' to rebuild the database, then restart nsd."