summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-dns/nsd')
-rw-r--r--net-dns/nsd/Manifest2
-rw-r--r--net-dns/nsd/files/nsd.initd53
-rw-r--r--net-dns/nsd/files/nsd.munin-conf2
-rw-r--r--net-dns/nsd/files/nsd.service14
-rw-r--r--net-dns/nsd/files/nsd3-patch.cron9
-rw-r--r--net-dns/nsd/files/nsd3.initd-r166
-rw-r--r--net-dns/nsd/files/nsd_munin_.patch17
-rw-r--r--net-dns/nsd/metadata.xml34
-rw-r--r--net-dns/nsd/nsd-3.2.18.ebuild77
-rw-r--r--net-dns/nsd/nsd-4.1.0.ebuild94
10 files changed, 368 insertions, 0 deletions
diff --git a/net-dns/nsd/Manifest b/net-dns/nsd/Manifest
new file mode 100644
index 000000000000..806cd1e290a6
--- /dev/null
+++ b/net-dns/nsd/Manifest
@@ -0,0 +1,2 @@
+DIST nsd-3.2.18.tar.gz 924566 SHA256 541047c2114466d6fa7d7b9f397f632e542750475f1fcef5339da86a1ebdfcdb SHA512 888618b51f8ec85413a95a9733198a5affc420b1a8c3b00ed18c8f73f1a0d0654b334ff22076adab23bac56ccb3684cb551ebec426d3d0df939eee24ae66044f WHIRLPOOL 0d4ea8d6e26fc517404e6ebc427774a9c1f4ec7c7c096f7adc5ba51f3fa218215f666dd848a48650bba502ceb4d2795ecb264014f5f31409290937b089b4f062
+DIST nsd-4.1.0.tar.gz 1056649 SHA256 ec3f6902f6f26a6b9248dcd7e9f42472fa52755740b4ba6b9d3bd08910b39b62 SHA512 1e49c14108b201ff8f14f58a9aae8ee4a69fba2e9494bdffc20ac079bff437ce91b069852d0aac639ec860a258b0b222b72269e62ad7b433c3df8d06afea8f03 WHIRLPOOL 6041ed2292412c91d3a7828727b5cf5f85cc6a0088e51cb791d2f56cfab2b8358627e1af7517091c3f119ce83218763dbd54279c88137c509bcf9e48c3049f94
diff --git a/net-dns/nsd/files/nsd.initd b/net-dns/nsd/files/nsd.initd
new file mode 100644
index 000000000000..b6eced79e546
--- /dev/null
+++ b/net-dns/nsd/files/nsd.initd
@@ -0,0 +1,53 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="NSD is an authoritative-only, high performance, open source name server"
+extra_commands="configtest"
+
+# 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}"
+
+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
+}
+
+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}")
+ 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..2fbec370f336
--- /dev/null
+++ b/net-dns/nsd/files/nsd.munin-conf
@@ -0,0 +1,2 @@
+[nsd_munin*]
+user root
diff --git a/net-dns/nsd/files/nsd.service b/net-dns/nsd/files/nsd.service
new file mode 100644
index 000000000000..8337557faeef
--- /dev/null
+++ b/net-dns/nsd/files/nsd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=NSD authoritative DNS server
+Wants=network.target
+After=network.target
+
+[Service]
+Type=forking
+ExecStartPre=/usr/bin/install -d -o nsd -g nsd /run/nsd
+ExecStart=/usr/sbin/nsd
+KillMode=mixed
+PIDFile=/run/nsd/nsd.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-dns/nsd/files/nsd3-patch.cron b/net-dns/nsd/files/nsd3-patch.cron
new file mode 100644
index 000000000000..ec27e4e95d4b
--- /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
+# $Id$
+
+# 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-r1 b/net-dns/nsd/files/nsd3.initd-r1
new file mode 100644
index 000000000000..46a71489fd2c
--- /dev/null
+++ b/net-dns/nsd/files/nsd3.initd-r1
@@ -0,0 +1,66 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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="${NSDC_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() {
+ 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/files/nsd_munin_.patch b/net-dns/nsd/files/nsd_munin_.patch
new file mode 100644
index 000000000000..96902f4ed195
--- /dev/null
+++ b/net-dns/nsd/files/nsd_munin_.patch
@@ -0,0 +1,17 @@
+--- contrib/nsd_munin_.orig 2013-08-08 23:14:27.000000000 +0200
++++ contrib/nsd_munin_ 2013-08-08 23:41:24.000000000 +0200
+@@ -87,10 +87,10 @@
+
+ =cut
+
+-state=${statefile:-/usr/local/var/munin/plugin-state/nsd-state}
+-conf=${nsd_conf:-/usr/local/etc/nsd.conf}
+-ctrl=${nsd_control:-/usr/local/sbin/nsd-control}
+-chkconf=${nsd_checkconf:-/usr/local/sbin/nsd-checkconf}
++state=${statefile:-$MUNIN_PLUGSTATE/nsd-state}
++conf=${nsd_conf:-/etc/nsd/nsd.conf}
++ctrl=${nsd_control:-/usr/sbin/nsd-control}
++chkconf=${nsd_checkconf:-/usr/sbin/nsd-checkconf}
+ lock=$state.lock
+
+ # number of seconds between polling attempts.
diff --git a/net-dns/nsd/metadata.xml b/net-dns/nsd/metadata.xml
new file mode 100644
index 000000000000..7a19ab55dfe0
--- /dev/null
+++ b/net-dns/nsd/metadata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>tom@whyscream.net</email>
+ <name>Tom Hendrikx</name>
+ <description>Please assign bugs</description>
+ </maintainer>
+ <maintainer>
+ <email>wschlich@gentoo.org</email>
+ <name>Wolfram Schlich</name>
+ <description>proxy-maintainer, please CC on bugs</description>
+ </maintainer>
+ <use>
+ <flag name='bind8-stats'>Enables BIND8 like NSTATS and XSTATS</flag>
+ <flag name='libevent'>Use libevent or libev, useful when zone
+ count is high</flag>
+ <flag name='minimal-responses'>If minimal responses are disabled,
+ responses are more likely to get truncated, resulting in TCP
+ fallback</flag>
+ <flag name='nsec3'>Enable NSEC3 support</flag>
+ <flag name='ratelimit'>Enables ratelimiting, based on query name,
+ type and source</flag>
+ <flag name='root-server'>Configure NSD as a root server</flag>
+ <flag name='runtime-checks'>Enable runtime checks, this could lead
+ to a reduced service level</flag>
+ <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.18.ebuild b/net-dns/nsd/nsd-3.2.18.ebuild
new file mode 100644
index 000000000000..5636fdeafa6e
--- /dev/null
+++ b/net-dns/nsd/nsd-3.2.18.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit user
+
+DESCRIPTION="An authoritative only, high performance, open source name server"
+HOMEPAGE="http://www.nlnetlabs.nl/projects/nsd"
+MY_PV=${PV/_rc/rc}
+MY_PV=${MY_PV/_beta/b}
+MY_P=${PN}-${MY_PV}
+S="${WORKDIR}/${MY_P}"
+SRC_URI="http://www.nlnetlabs.nl/downloads/${PN}/${MY_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
+"
+
+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-r1 nsd
+
+ # remove /var/run data created by Makefile, handled by initd script
+ rm -r "${D}"/var/run || die "could not remove /var/run/ directory"
+
+}
+
+pkg_postinst() {
+ enewgroup nsd
+ enewuser nsd -1 -1 -1 nsd
+
+ # database directory, writable by nsd for database updates and zone transfers
+ install -d -m 750 -o nsd -g nsd "${EROOT%/}"/var/db/nsd
+
+ # zones directory, writable by root for 'nsdc patch'
+ install -d -m 750 -o root -g nsd "${EROOT%/}"/var//nsd
+}
diff --git a/net-dns/nsd/nsd-4.1.0.ebuild b/net-dns/nsd/nsd-4.1.0.ebuild
new file mode 100644
index 000000000000..1fb9ee291d0d
--- /dev/null
+++ b/net-dns/nsd/nsd-4.1.0.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit user eutils systemd
+
+DESCRIPTION="An authoritative only, high performance, open source name server"
+HOMEPAGE="http://www.nlnetlabs.nl/projects/nsd"
+# version voodoo needed only for non-release tarballs: 4.0.0_rc1 => 4.0.0rc1
+MY_PV=${PV/_rc/rc}
+MY_PV=${MY_PV/_beta/b}
+MY_P=${PN}-${MY_PV}
+S="${WORKDIR}/${MY_P}"
+SRC_URI="http://www.nlnetlabs.nl/downloads/${PN}/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="bind8-stats ipv6 libevent minimal-responses mmap munin +nsec3 ratelimit root-server runtime-checks ssl"
+
+RDEPEND="
+ dev-libs/openssl
+ virtual/yacc
+ libevent? ( dev-libs/libevent )
+ ssl? ( dev-libs/openssl )
+ munin? ( net-analyzer/munin )
+"
+DEPEND="
+ ${RDEPEND}
+ sys-devel/flex
+"
+
+src_prepare() {
+ # Fix the paths in the munin plugin to match our install
+ epatch "${FILESDIR}"/nsd_munin_.patch
+}
+
+src_configure() {
+ econf \
+ --enable-largefile \
+ --with-logfile="${EPREFIX}"/var/log/nsd.log \
+ --with-pidfile="${EPREFIX}"/run/nsd/nsd.pid \
+ --with-dbfile="${EPREFIX}"/var/db/nsd/nsd.db \
+ --with-xfrdir="${EPREFIX}"/var/db/nsd \
+ --with-xfrdfile="${EPREFIX}"/var/db/nsd/xfrd.state \
+ --with-zonelistfile="${EPREFIX}"/var/db/nsd/zone.list \
+ --with-zonesdir="${EPREFIX}"/var/lib/nsd \
+ $(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_with libevent) \
+ $(use_with ssl)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc doc/{ChangeLog,CREDITS,NSD-4-features,NSD-FOR-BIND-USERS,README,RELNOTES,REQUIREMENTS}
+
+ newinitd "${FILESDIR}"/nsd.initd nsd
+
+ # 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
+
+ systemd_dounit "${FILESDIR}"/nsd.service
+
+ # remove the /run directory that usually resides on tmpfs and is
+ # being taken care of by the nsd init script anyway (checkpath)
+ rm -rf "${D}"/run || die "Failed to remove /run"
+}
+
+pkg_postinst() {
+ # Do this in postinst to ensure the uid/gid is consistent for binpkgs
+ enewgroup nsd
+ enewuser nsd -1 -1 -1 nsd
+
+ # database directory, writable by nsd for database updates and zone transfers
+ install -d -m 750 -o nsd -g nsd "${EROOT%/}"/var/db/nsd
+
+ # zones directory, writable by nsd for zone file updates (nsd-control write)
+ install -d -m 750 -o nsd -g nsd "${EROOT%/}"/var/lib/nsd
+}