diff options
author | Wolfram Schlich <wschlich@gentoo.org> | 2013-04-03 19:10:39 +0000 |
---|---|---|
committer | Wolfram Schlich <wschlich@gentoo.org> | 2013-04-03 19:10:39 +0000 |
commit | 6d299437e2d008f1e958649d1ffb816674257ab1 (patch) | |
tree | ed5f4b598c3ac24eeeae486ea94dace01d0175c3 /net-dns/nsd | |
parent | Make dev-libs/libnl dependency optional (bug #462030). (diff) | |
download | gentoo-2-6d299437e2d008f1e958649d1ffb816674257ab1.tar.gz gentoo-2-6d299437e2d008f1e958649d1ffb816674257ab1.tar.bz2 gentoo-2-6d299437e2d008f1e958649d1ffb816674257ab1.zip |
added nsd-3.x ebuild, added nsd-4.x munin plugin config. thanks to Tom Hendrikx <tom@whyscream.net>
(Portage version: 2.2.0_alpha170/cvs/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'net-dns/nsd')
-rw-r--r-- | net-dns/nsd/ChangeLog | 12 | ||||
-rw-r--r-- | net-dns/nsd/files/nsd.initd | 8 | ||||
-rw-r--r-- | net-dns/nsd/files/nsd.munin-conf | 7 | ||||
-rw-r--r-- | net-dns/nsd/files/nsd3-patch.cron | 9 | ||||
-rw-r--r-- | net-dns/nsd/files/nsd3.initd | 70 | ||||
-rw-r--r-- | net-dns/nsd/metadata.xml | 2 | ||||
-rw-r--r-- | net-dns/nsd/nsd-3.2.15.ebuild | 77 | ||||
-rw-r--r-- | net-dns/nsd/nsd-4.0.0_beta4-r1.ebuild (renamed from net-dns/nsd/nsd-4.0.0_beta4.ebuild) | 6 |
8 files changed, 182 insertions, 9 deletions
diff --git a/net-dns/nsd/ChangeLog b/net-dns/nsd/ChangeLog index 621aaa3797d8..daece126e805 100644 --- a/net-dns/nsd/ChangeLog +++ b/net-dns/nsd/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for net-dns/nsd # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/ChangeLog,v 1.4 2013/03/17 15:17:11 hwoarang Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/ChangeLog,v 1.5 2013/04/03 19:10:39 wschlich Exp $ + +*nsd-4.0.0_beta4-r1 (03 Apr 2013) +*nsd-3.2.15 (03 Apr 2013) + + 03 Apr 2013; Wolfram Schlich <wschlich@gentoo.org> +files/nsd.munin-conf, + +files/nsd3-patch.cron, +files/nsd3.initd, +nsd-3.2.15.ebuild, + +nsd-4.0.0_beta4-r1.ebuild, -nsd-4.0.0_beta4.ebuild, files/nsd.initd, + metadata.xml: + added nsd-3.x ebuild, added nsd-4.x munin plugin config. thanks to Tom + Hendrikx <tom@whyscream.net> 17 Mar 2013; Markos Chandras <hwoarang@gentoo.org> metadata.xml: Add proxy-maintainers to metadata.xml diff --git a/net-dns/nsd/files/nsd.initd b/net-dns/nsd/files/nsd.initd index ffc283c2d64a..3d126393bc7e 100644 --- a/net-dns/nsd/files/nsd.initd +++ b/net-dns/nsd/files/nsd.initd @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/files/nsd.initd,v 1.1 2013/01/30 10:43:02 wschlich Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/files/nsd.initd,v 1.2 2013/04/03 19:10:39 wschlich Exp $ description="NSD is an authoritative-only, high performance, open source name server" extra_commands="configtest" @@ -28,7 +28,7 @@ checkconfig() { eerror "An example can be found in /etc/nsd/nsd.conf.sample" return 1 elif ! "${NSD_CHECKCONF}" "${NSD_CONFIG}"; then - eerror "You have errors in your configfile (${config_file})" + eerror "You have errors in your configfile (${NSD_CONFIG})" return $? fi return 0 @@ -36,11 +36,9 @@ checkconfig() { start() { ebegin "Starting NSD" - checkconfig || return $? local pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") checkpath --directory --owner nsd:nsd $(dirname "${pidfile}") - start-stop-daemon --start --pidfile "${pidfile}" \ --exec "${NSD_BINARY}" -- -c "${NSD_CONFIG}" eend $? @@ -48,10 +46,8 @@ start() { stop() { ebegin "Stopping NSD" - checkconfig || return $? local pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") - start-stop-daemon --stop --pidfile "${pidfile}" eend $? } diff --git a/net-dns/nsd/files/nsd.munin-conf b/net-dns/nsd/files/nsd.munin-conf new file mode 100644 index 000000000000..25b3e9a0e83a --- /dev/null +++ b/net-dns/nsd/files/nsd.munin-conf @@ -0,0 +1,7 @@ +# Set default paths for nsd_munin_ plugin +[nsd_munin*] +user root +env.statefile /var/lib/munin-node/plugin-state/root/nsd-state +env.nsd_conf /etc/nsd/nsd.conf +env.nsd_control /usr/sbin/nsd-control +env.nsd_checkconf /usr/sbin/nsd-checkconf diff --git a/net-dns/nsd/files/nsd3-patch.cron b/net-dns/nsd/files/nsd3-patch.cron new file mode 100644 index 000000000000..0a713b8b3671 --- /dev/null +++ b/net-dns/nsd/files/nsd3-patch.cron @@ -0,0 +1,9 @@ +#!/bin/sh +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/files/nsd3-patch.cron,v 1.1 2013/04/03 19:10:39 wschlich Exp $ + +# Cron job: merge zone transfer changes back to zone files +# Needed for nsd3 only + +/etc/init.d/nsd --quiet status && /etc/init.d/nsd patch >/dev/null diff --git a/net-dns/nsd/files/nsd3.initd b/net-dns/nsd/files/nsd3.initd new file mode 100644 index 000000000000..c3acd93aedfd --- /dev/null +++ b/net-dns/nsd/files/nsd3.initd @@ -0,0 +1,70 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/files/nsd3.initd,v 1.1 2013/04/03 19:10:39 wschlich Exp $ + +description="NSD is an authoritative-only, high performance, open source name server" +extra_commands="configtest patch" + +# these can be overridden in /etc/conf.d/nsd if necessary +NSD_CONFIG="${NSD_CONFIG:-/etc/nsd/nsd.conf}" +NSD_BINARY="${NSD_BINARY:-/usr/sbin/nsd}" +NSD_CHECKCONF="${NSD_CHECKCONF:-/usr/sbin/nsd-checkconf}" +NSDC_BINARY="${NSD_BINARY:-/usr/sbin/nsdc}" + +depend() { + need net + use logger +} + +configtest() { + ebegin "Checking ${SVCNAME} configuration" + checkconfig + eend $? +} + +checkconfig() { + if ! test -e "${NSD_CONFIG}"; then + eerror "You need to create an appropriate config file." + eerror "An example can be found in /etc/nsd/nsd.conf.sample" + return 1 + elif ! "${NSD_CHECKCONF}" "${NSD_CONFIG}"; then + eerror "You have errors in your configfile (${NSD_CONFIG})" + return $? + fi + return 0 +} + +patch() { + if ! test -x "${NSDC_BINARY}"; then + # nsdc binary only available in nsd3, patching not needed for nsd4 + return 0 + fi + local difffile=$(${NSD_CHECKCONF} -o difffile "${NSD_CONFIG}") + if ! test -s "${difffile}"; then + # no difffile found or difffile empty, so no patching required + return 0 + fi + ebegin "Patching NSD zone files" + "${NSDC_BINARY}" patch >/dev/null + eend $? +} + +start() { + ebegin "Starting NSD" + checkconfig || return $? + local pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") + checkpath --directory --owner nsd:nsd $(dirname "${pidfile}") + start-stop-daemon --start --pidfile "${pidfile}" \ + --exec "${NSD_BINARY}" -- -c "${NSD_CONFIG}" + eend $? +} + +stop() { + ebegin "Stopping NSD" + checkconfig || return $? + local pidfile=$("${NSD_CHECKCONF}" -o pidfile "${NSD_CONFIG}") + patch || return $? + start-stop-daemon --stop --pidfile "${pidfile}" + eend $? +} diff --git a/net-dns/nsd/metadata.xml b/net-dns/nsd/metadata.xml index b498d2a28b2a..7a19ab55dfe0 100644 --- a/net-dns/nsd/metadata.xml +++ b/net-dns/nsd/metadata.xml @@ -28,5 +28,7 @@ <flag name='munin'> Install a plugin for <pkg>net-analyzer/munin</pkg> to graph statistical data from nsd.</flag> + <flag name='zone-stats'>Enable per-zone statistics logging, this + could lead to a reduced service level</flag> </use> </pkgmetadata> diff --git a/net-dns/nsd/nsd-3.2.15.ebuild b/net-dns/nsd/nsd-3.2.15.ebuild new file mode 100644 index 000000000000..227ff1ec68e1 --- /dev/null +++ b/net-dns/nsd/nsd-3.2.15.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/nsd-3.2.15.ebuild,v 1.1 2013/04/03 19:10:39 wschlich Exp $ + +EAPI=4 + +inherit user + +DESCRIPTION="An authoritative only, high performance, open source name server" +HOMEPAGE="http://www.nlnetlabs.nl/projects/nsd" +SRC_URI="http://www.nlnetlabs.nl/downloads/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="bind8-stats ipv6 minimal-responses mmap +nsec3 ratelimit root-server runtime-checks zone-stats" + +RDEPEND=" + dev-libs/openssl + virtual/yacc +" +DEPEND=" + ${RDEPEND} + sys-devel/flex +" + +pkg_setup() { + enewgroup nsd + enewuser nsd -1 -1 -1 nsd +} + +src_configure() { + # ebuild.sh sets localstatedir to /var/lib, but nsd expects /var in several locations + # some of these cannot be changed by arguments to econf/configure, f.i. logfile + econf \ + --localstatedir="${EPREFIX}/var" \ + --with-pidfile="${EPREFIX}/var/run/nsd/nsd.pid" \ + --with-zonesdir="${EPREFIX}/var/lib/nsd" \ + --enable-largefile \ + $(use_enable bind8-stats) \ + $(use_enable ipv6) \ + $(use_enable minimal-responses) \ + $(use_enable mmap) \ + $(use_enable nsec3) \ + $(use_enable ratelimit) \ + $(use_enable root-server) \ + $(use_enable runtime-checks checking) \ + $(use_enable zone-stats) +} + +src_install() { + emake DESTDIR="${D}" install + + dodoc doc/{ChangeLog,CREDITS,NSD-FOR-BIND-USERS,README,RELNOTES,REQUIREMENTS} + + insinto /usr/share/nsd + doins contrib/nsd.zones2nsd.conf + + exeinto /etc/cron.daily + newexe "${FILESDIR}"/nsd3-patch.cron nsd-patch.cron + + newinitd "${FILESDIR}"/nsd3.initd nsd + + # database directory, writable by nsd for database updates and zone transfers + dodir /var/db/nsd + fowners nsd:nsd /var/db/nsd + fperms 750 /var/db/nsd + + # zones directory, writable by root for 'nsdc patch' + dodir /var/lib/nsd + fowners root:nsd /var/lib/nsd + fperms 750 /var/lib/nsd + + # remove /var/run data created by Makefile, handled by initd script + rm -r "${D}"/var/run || die "could not remove /var/run/ directory" + +} diff --git a/net-dns/nsd/nsd-4.0.0_beta4.ebuild b/net-dns/nsd/nsd-4.0.0_beta4-r1.ebuild index 191e7eef1358..601004e78fc7 100644 --- a/net-dns/nsd/nsd-4.0.0_beta4.ebuild +++ b/net-dns/nsd/nsd-4.0.0_beta4-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/nsd-4.0.0_beta4.ebuild,v 1.1 2013/02/06 12:34:24 wschlich Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/nsd/nsd-4.0.0_beta4-r1.ebuild,v 1.1 2013/04/03 19:10:39 wschlich Exp $ EAPI=4 @@ -76,10 +76,12 @@ src_install() { fowners nsd:nsd /var/lib/nsd fperms 750 /var/lib/nsd - # install munin plugin + # install munin plugin and config if use munin; then exeinto /usr/libexec/munin/plugins doexe contrib/nsd_munin_ + insinto /etc/munin/plugin-conf.d + newins "${FILESDIR}"/nsd.munin-conf nsd_munin fi # remove the /run directory that usually resides on tmpfs and is |