]> Pileus Git - ~andy/sunrise/blob - net-dns/nsd/nsd-3.2.15.ebuild
media-video/ucview: fix metadata.xml
[~andy/sunrise] / net-dns / nsd / nsd-3.2.15.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=4
6
7 inherit user versionator
8
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"
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="bind8-stats ipv6 minimal-responses mmap +nsec3 ratelimit root-server runtime-checks zone-stats"
17
18 RDEPEND="
19         dev-libs/openssl
20         virtual/yacc
21 "
22 DEPEND="
23         ${RDEPEND}
24         sys-devel/flex
25 "
26
27 pkg_setup() {
28         enewgroup nsd
29         enewuser nsd -1 -1 -1 nsd
30 }
31
32 src_configure() {
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
35         econf \
36                 --localstatedir="${EPREFIX}/var" \
37                 --with-pidfile="${EPREFIX}/var/run/nsd/nsd.pid" \
38                 --with-zonesdir="${EPREFIX}/var/lib/nsd" \
39                 --enable-largefile \
40                 $(use_enable bind8-stats) \
41                 $(use_enable ipv6) \
42                 $(use_enable minimal-responses) \
43                 $(use_enable mmap) \
44                 $(use_enable nsec3) \
45                 $(use_enable ratelimit) \
46                 $(use_enable root-server) \
47                 $(use_enable runtime-checks checking) \
48                 $(use_enable zone-stats)
49 }
50
51 src_install() {
52         emake DESTDIR="${D}" install
53
54         dodoc doc/{ChangeLog,CREDITS,NSD-FOR-BIND-USERS,README,RELNOTES,REQUIREMENTS}
55
56         insinto /usr/share/nsd
57         doins contrib/nsd.zones2nsd.conf
58
59         exeinto /etc/cron.daily
60         doexe "${FILESDIR}"/nsd.cron
61
62         newinitd "${FILESDIR}"/nsd.initd nsd
63         newconfd "${FILESDIR}"/nsd.confd nsd
64
65         # database directory, writable by nsd for ixfr.db file
66         dodir /var/db/nsd
67         fowners nsd:nsd /var/db/nsd
68         fperms 750 /var/db/nsd
69
70         # zones directory, writable by root for 'nsdc patch'
71         dodir /var/lib/nsd
72         fowners root:nsd /var/lib/nsd
73         fperms 750 /var/lib/nsd
74
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"
77
78 }
79
80 pkg_postinst() {
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."
85         fi
86 }