]> Pileus Git - ~andy/sunrise/blob - net-dns/nsd/nsd-3.2.2.ebuild
d31b4dfa3e7d0a8bea3b94b40d0c39e9f6097623
[~andy/sunrise] / net-dns / nsd / nsd-3.2.2.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit autotools eutils
6
7 DESCRIPTION="An authoritative only, high performance, open source name server"
8 HOMEPAGE="http://www.nlnetlabs.nl/projects/nsd"
9 SRC_URI="http://www.nlnetlabs.nl/downloads/${PN}/${P}.tar.gz"
10
11 LICENSE="BSD"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="bind8-stats dnssec ipv6 largefile nsec3 nsid root-server runtime-checks tsig"
15
16 DEPEND="tsig? ( dev-libs/openssl )"
17 RDEPEND=${DEPEND}
18
19 pkg_setup() {
20         if use runtime-checks; then
21                 ewarn "You enabled runtime-checks USE flag, this could lead to a reduced service level"
22         fi
23         if use nsid; then
24                 ewarn "You enabled nsid USE flag, this is still experimental"
25         fi
26
27         enewgroup nsd
28         enewuser nsd -1 -1 -1 nsd
29 }
30
31 src_unpack() {
32         unpack ${A}
33         cd "${S}"
34         epatch "${FILESDIR}/${P}-Makefile.in.patch"
35
36         eautoreconf
37 }
38
39 src_compile() {
40         econf \
41                 --with-dbfile=/var/db/nsd/nsd.db \
42                 --with-difffile=/var/db/nsd/ixfr.db \
43                 --with-pidfile=/var/run/nsd.pid \
44                 --with-xfrdfile=/var/db/nsd/xfrd.state \
45                 --with-zonesdir=/var/lib/nsd \
46                 $(use_enable bind8-stats) \
47                 $(use_enable dnssec) \
48                 $(use_enable largefile) \
49                 $(use_enable ipv6) \
50                 $(use_enable nsec3) \
51                 $(use_enable nsid) \
52                 $(use_enable root-server) \
53                 $(use_enable runtime-checks checking) \
54                 $(use_enable tsig)
55
56         emake || die "emake failed"
57 }
58
59 src_install() {
60         emake DESTDIR="${D}" install || die "emake install failed"
61
62         dodoc doc/{ChangeLog,CREDITS,NSD-FOR-BIND-USERS,README,REQUIREMENTS} || die "dodoc failed"
63
64         insinto /usr/share/${PN}
65         doins "${FILESDIR}/nsd.cron" || die "doins failed"
66         doins contrib/nsd.zones2nsd.conf || die "doins failed"
67
68         newinitd "${FILESDIR}"/nsd.initd nsd || die "newinitd failed"
69         newconfd "${FILESDIR}"/nsd.confd nsd || die "newconfd failed"
70
71         # database directory, writable by nsd for ixfr.db file
72         keepdir /var/db/nsd
73         fowners nsd:nsd /var/db/nsd
74         fperms 750 /var/db/nsd
75
76         # zones directory, writable by root for 'nsdc patch'
77         keepdir /var/lib/nsd
78         fowners root:nsd /var/lib/nsd
79         fperms 750 /var/lib/nsd
80 }
81
82 pkg_postinst() {
83         elog "If you are using bind and want to convert (or sync) bind zones"
84         elog "you should check out bind2nsd (http://bind2nsd.sourceforge.net)."
85         echo
86         elog "To automatically merge zone transfer changes back to NSD's"
87         elog "zone files using 'nsdc patch', try nsd.cron in /usr/share/${PN}"
88 }