summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-dns')
-rw-r--r--net-dns/nsd/ChangeLog7
-rw-r--r--net-dns/nsd/Manifest9
-rw-r--r--net-dns/nsd/files/nsd.confd2
-rw-r--r--net-dns/nsd/files/nsd.cron9
-rw-r--r--net-dns/nsd/files/nsd.initd71
-rw-r--r--net-dns/nsd/nsd-3.2.0-r1.ebuild (renamed from net-dns/nsd/nsd-3.2.0.ebuild)31
6 files changed, 79 insertions, 50 deletions
diff --git a/net-dns/nsd/ChangeLog b/net-dns/nsd/ChangeLog
index add0279d8..8b287b352 100644
--- a/net-dns/nsd/ChangeLog
+++ b/net-dns/nsd/ChangeLog
@@ -1,7 +1,12 @@
# ChangeLog for net-dns/nsd
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 18 Jan 2009; Tom Hendrikx (whyscream) <tom@whyscream.net>
+ -nsd-3.2.0.ebuild, +nsd-3.2.0-r1.ebuild, +files/nsd.confd, files/nsd.cron,
+ files/nsd.initd:
+ improved ebuild and initd script
+
31 Aug 2008; Thomas Sachau (Tommy[D]) <tommy@gentoo.org> metadata.xml:
Add local useflags to metadata.xml (GLEP 56)
diff --git a/net-dns/nsd/Manifest b/net-dns/nsd/Manifest
index de6d436f5..b33a57813 100644
--- a/net-dns/nsd/Manifest
+++ b/net-dns/nsd/Manifest
@@ -1,6 +1,7 @@
-AUX nsd.cron 114 RMD160 ff9a08bd8bbe2ec6918e89ae29fa9fb0f9ecc101 SHA1 57834a23d34e1c4bd8e1ba803bf9d19307f46333 SHA256 f389cbfb92ced8968d3e09eb7f1732f09d7077e671ec734b3e918a8007c87d8f
-AUX nsd.initd 1177 RMD160 e0dfead663e427bab397c43f8f07e959cc5fa53b SHA1 6245709a6400faf8e47fd29692cfc35677d7117b SHA256 3601fccc22312b76f1a59faaf3bcbe5c89b0a9957a8483f74a67a3a008258107
+AUX nsd.confd 104 RMD160 cd15a20757fd4db72a2da5327d68f4d6561bb271 SHA1 5fab374d008609d8aba9adb2a6eb0574f4ea4596 SHA256 de3c05a7b898b86f544ebc5804540dbf9736695cb21d614964561294533f2050
+AUX nsd.cron 227 RMD160 9a78cfc2bfb18ada86c42e24310416043d30a4f4 SHA1 feed7a81954ba03e85457ee731ca7475098bd189 SHA256 8d62364ac608edacbb1e1d2a80c3b9490600eca65c796f84b394a6289618778c
+AUX nsd.initd 1564 RMD160 def86cc589c7b004a734110b3c75639b51acbc57 SHA1 cd9244a54aeb61e42a57038ec895c8130436f549 SHA256 ffd8019da6e8b60156bd232a7612112deee957eafb8d8eb9f3a149827fad14da
DIST nsd-3.2.0.tar.gz 838331 RMD160 da08b5677c905bf64a954091ea1be8d16ef0290d SHA1 7cc37fdd10f4ad78ed58d4e1a304a4496ebaefe7 SHA256 5ef1fd0afcd4c11cb34c008a78106da6331b8fddf178ae27039dd89b6ef059a4
-EBUILD nsd-3.2.0.ebuild 2079 RMD160 07f7f0b8a2791fcfa0cd697066c5080a5dce0896 SHA1 2afd5e6bb54a9104ff47e9a20bf4646645ed65b8 SHA256 32b1d59aa8e98de369724b59583b037f18a33b100af38d74b683bda6fcf4ca5b
-MISC ChangeLog 1170 RMD160 1097c9290170c53ac07d6150bb276e381e3e2e92 SHA1 60676c7eda4a00add61e3e94689c751284393039 SHA256 188de771b9c7c797dd4e0422d69308f6a79aec8bf2be76128b469575c9accd16
+EBUILD nsd-3.2.0-r1.ebuild 2286 RMD160 a9891f61f0773e20f0dc4c96cac1de34b86368b3 SHA1 a197a1c73b0a77ccf308f6a133c96d5beafc1868 SHA256 0a4d70118898c7cd3068cf0ad082255694672ed21a34c7c72a243e9f324f75ba
+MISC ChangeLog 1362 RMD160 fa96641e88a7628750b9ce45300671d561d7aa73 SHA1 c3e43c666f66c8fa3ec8c9849798e2fae2680189 SHA256 4f76a9886e8cc405cdc4789ca65033f98c0154256f704a85a1d804edaf1558b3
MISC metadata.xml 636 RMD160 5545e97a08014c4e8fef86b6c31beb256bd0afa3 SHA1 fffb9c46af8579e12630200c015e2e8d20d4095f SHA256 68459d2bd40c279d1130dc09006f1efc8c094ee0131fd77f56ede70c7766fa85
diff --git a/net-dns/nsd/files/nsd.confd b/net-dns/nsd/files/nsd.confd
new file mode 100644
index 000000000..f6c365244
--- /dev/null
+++ b/net-dns/nsd/files/nsd.confd
@@ -0,0 +1,2 @@
+# Location of the nsd configuration file. Leave empty for the default.
+#config_file="/etc/nsd/nsd.conf"
diff --git a/net-dns/nsd/files/nsd.cron b/net-dns/nsd/files/nsd.cron
index 1174d407a..36aaf32b0 100644
--- a/net-dns/nsd/files/nsd.cron
+++ b/net-dns/nsd/files/nsd.cron
@@ -1,7 +1,10 @@
#!/bin/sh
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
#
-NSDC_BIN="/usr/sbin/nsdc"
+my_nsdc="/usr/sbin/nsdc"
-if [[ -x ${NSDC_BIN} ]]; then
- ${NSDC_BIN} update >>/dev/null 2>&1
+if [[ -x ${my_nsdc} ]]; then
+ ${my_nsdc} patch 1>/dev/null
fi
diff --git a/net-dns/nsd/files/nsd.initd b/net-dns/nsd/files/nsd.initd
index 6295e018e..a2ad26a73 100644
--- a/net-dns/nsd/files/nsd.initd
+++ b/net-dns/nsd/files/nsd.initd
@@ -1,16 +1,17 @@
#!/sbin/runscript
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
-opts="${opts} reload configtest"
+opts="${opts} reload"
description="NSD is an authoritative only, high performance, open source name server"
description_start="Start the server"
description_stop="Stop the server"
-description_configtest="Check the syntax of the configuration file"
-description_reload="Reload the database file"
+description_reload="Rebuild zone database and reload it"
-CONTROL="/usr/sbin/nsdc"
+config_file=${config_file:-/etc/nsd/nsd.conf}
+my_nsdc="/usr/sbin/nsdc"
+my_nsd_checkconf="/usr/sbin/nsd-checkconf"
depend() {
need net
@@ -18,40 +19,56 @@ depend() {
provide auth-dns
}
-configtest() {
- ebegin "Checking config"
- if [ ! -e "/etc/nsd/nsd.conf" ]; then
- eerror "You need to create an appropriate config file"
- eerror "in /etc/nsd/ . An example can be found in /etc/nsd/nsd.conf.sample"
- return 1
- fi
-
- if ! nsd-checkconf "/etc/nsd/nsd.conf"; then
- eerror "You have errors in your configfile"
- return 1
- fi
- eend
+_checkconf() {
+ if [ ! -e "${config_file}" ]; then
+ eerror "You need to create an appropriate config file."
+ eerror "An example can be found in /etc/nsd/nsd.conf.sample"
+ return 1
+ fi
+
+ if ! ${my_nsd_checkconf} "${config_file}"; then
+ eerror "You have errors in your configfile (${config_file})"
+ return 1
+ fi
+ return 0
}
-start() {
- configtest || return 1
+_patch() {
+ local difffile=`${my_nsd_checkconf} -o difffile ${config_file}`
+ if test -s ${difffile}; then
+ ebegin "Patching NSD zone files"
+ ${my_nsdc} patch > /dev/null
+ eend $?
+ fi
+}
+_rebuild() {
+ if ! ${my_nsdc} rebuild > /dev/null; then
+ eerror "There was an error rebuilding the database. Please review your zone files."
+ return 1
+ fi
+ return 0
+}
+
+start() {
ebegin "Starting NSD"
- ${CONTROL} start
- ${CONTROL} running
+ _checkconf || return 1
+ ${my_nsdc} start
+ ${my_nsdc} running
eend $?
}
stop() {
ebegin "Stopping NSD"
- ${CONTROL} patch
- ${CONTROL} stop
+ _patch
+ ${my_nsdc} stop
eend $?
}
reload() {
- configtest || return 1
- ebegin "Reloading NSD"
- ${CONTROL} reload
+ ebegin "Rebuilding and reloading NSD zone database"
+ _checkconf || return 1
+ _rebuild || return 1
+ ${my_nsdc} reload
eend $?
}
diff --git a/net-dns/nsd/nsd-3.2.0.ebuild b/net-dns/nsd/nsd-3.2.0-r1.ebuild
index ee48c2de7..324368d66 100644
--- a/net-dns/nsd/nsd-3.2.0.ebuild
+++ b/net-dns/nsd/nsd-3.2.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
@@ -6,14 +6,14 @@ inherit eutils
DESCRIPTION="An authoritative only, high performance, open source name server"
HOMEPAGE="http://www.nlnetlabs.nl/projects/nsd"
-SRC_URI="http://www.nlnetlabs.nl/downloads/nsd/${P}.tar.gz"
+SRC_URI="http://www.nlnetlabs.nl/downloads/${PN}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="bind8-stats dnssec ipv6 largefile nsec3 nsid root-server runtime-checks tsig"
-DEPEND="tsig? ( >=dev-libs/openssl-0.9.8f )"
+DEPEND="tsig? ( dev-libs/openssl )"
pkg_setup() {
if use runtime-checks; then
@@ -23,7 +23,8 @@ pkg_setup() {
ewarn "You enabled nsid USE flag, this is still experimental"
fi
- enewuser nsd -1 -1 /var/lib/nsd
+ enewgroup nsd
+ enewuser nsd -1 -1 -1 nsd
}
src_compile() {
@@ -49,20 +50,23 @@ src_compile() {
src_install() {
emake DESTDIR="${D}" install || die "emake install failed"
- dodoc doc/*
- dodoc contrib/nsd.zones2nsd.conf
- dodoc "${FILESDIR}"/nsd.cron
+ dodoc doc/{ChangeLog,CREDITS,NSD-FOR-BIND-USERS,README,REQUIREMENTS} || die "dodoc failed"
- dobin nsdc.sh
+ insinto /usr/share/${PN}
+ doins "${FILESDIR}/nsd.cron" || die "doins failed"
+ doins contrib/nsd.zones2nsd.conf || die "doins failed"
- newinitd "${FILESDIR}"/nsd.initd nsd
+ newinitd "${FILESDIR}"/nsd.initd nsd || die "newinitd failed"
+ newconfd "${FILESDIR}"/nsd.confd nsd || die "newconfd failed"
+ # database directory, writable by nsd for ixfr.db file
keepdir /var/db/nsd
- fowners nsd /var/db/nsd
+ fowners nsd:nsd /var/db/nsd
fperms 750 /var/db/nsd
+ # zones directory, writable by root for 'nsdc patch'
keepdir /var/lib/nsd
- fowners nsd /var/lib/nsd
+ fowners root:nsd /var/lib/nsd
fperms 750 /var/lib/nsd
}
@@ -70,9 +74,6 @@ pkg_postinst() {
elog "If you are using bind and want to convert (or sync) bind zones"
elog "you should check out bind2nsd (http://bind2nsd.sourceforge.net)."
echo
- elog "If you are upgrading from NSD 2, take a look at the provided"
- elog "nsd.zones2nsd.conf script in the doc directory."
- echo
elog "To automatically merge zone transfer changes back to NSD's"
- elog "zone files using 'nsdc patch', try the nsd.cron in the doc directory"
+ elog "zone files using 'nsdc patch', try nsd.cron in /usr/share/${PN}"
}