]> Pileus Git - ~andy/sunrise/blob - net-dns/nsd/nsd-3.2.14-r1.ebuild
drop -f switch from rm
[~andy/sunrise] / net-dns / nsd / nsd-3.2.14-r1.ebuild
1 # Copyright 1999-2012 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 mmap +nsec3 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 mmap) \
43                 $(use_enable nsec3) \
44                 $(use_enable root-server) \
45                 $(use_enable runtime-checks checking) \
46                 $(use_enable zone-stats)
47 }
48
49 src_install() {
50         emake DESTDIR="${D}" install
51
52         dodoc doc/{ChangeLog,CREDITS,NSD-FOR-BIND-USERS,README,RELNOTES,REQUIREMENTS}
53
54         insinto /usr/share/nsd
55         doins contrib/nsd.zones2nsd.conf
56
57         exeinto /etc/cron.daily
58         doexe "${FILESDIR}"/nsd.cron
59
60         newinitd "${FILESDIR}"/nsd.initd nsd
61         newconfd "${FILESDIR}"/nsd.confd nsd
62
63         # database directory, writable by nsd for ixfr.db file
64         dodir /var/db/nsd
65         fowners nsd:nsd /var/db/nsd
66         fperms 750 /var/db/nsd
67
68         # zones directory, writable by root for 'nsdc patch'
69         dodir /var/lib/nsd
70         fowners root:nsd /var/lib/nsd
71         fperms 750 /var/lib/nsd
72
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"
75
76 }
77
78 pkg_postinst() {
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."
83         fi
84 }