From 588fc4c6d4e929d3c5871a593f4a2c282f331f5e Mon Sep 17 00:00:00 2001 From: Micha Glave Date: Mon, 30 Nov 2015 11:20:44 +0100 Subject: [PATCH] net-dns/nsd-4.1.6 --- net-dns/nsd/Manifest | 8 +++ net-dns/nsd/files/nsd.initd | 53 +++++++++++++++++ net-dns/nsd/files/nsd.munin-conf | 2 + net-dns/nsd/files/nsd.service | 14 +++++ net-dns/nsd/files/nsd_munin_.patch | 17 ++++++ net-dns/nsd/nsd-4.1.6.ebuild | 95 ++++++++++++++++++++++++++++++ 6 files changed, 189 insertions(+) create mode 100644 net-dns/nsd/Manifest create mode 100644 net-dns/nsd/files/nsd.initd create mode 100644 net-dns/nsd/files/nsd.munin-conf create mode 100644 net-dns/nsd/files/nsd.service create mode 100644 net-dns/nsd/files/nsd_munin_.patch create mode 100644 net-dns/nsd/nsd-4.1.6.ebuild diff --git a/net-dns/nsd/Manifest b/net-dns/nsd/Manifest new file mode 100644 index 0000000..1070dee --- /dev/null +++ b/net-dns/nsd/Manifest @@ -0,0 +1,8 @@ +AUX nsd.initd 1376 SHA256 204e763b0c74a068b6a1f55bfb4886a7c096a967586af7ade650bd905129a6c3 SHA512 ff3de8f7ff03c9974118cadebfa9987795429d7d547370d2d7ed01eefe4de083da70fed073b1531925b2b8b97c51163353684039d20c0ca2424f46fa501d724a WHIRLPOOL 8daf037eb198734a7fd47d0ab76a50fd861d42db492bd3a5a5679ac119bebfa65f8e1b115ee2cc2783b5d1ace69bd748a2df06baec09c4e3d37020121290c598 +AUX nsd.munin-conf 23 SHA256 313e0bd8841d10962eeb1fc9fec480dce7ea93dae8a673c74e45efc12d3087da SHA512 c06d0b035387e7be79cfa8fedf8afb3900772146c6d4090ac39ea2ef165772d875b222ef467bd73422078ef57818bcc931ca67fa290bd99a7a9456efa5448853 WHIRLPOOL 74509d12b52570d9fe8dcf87820162e3bab5c77650daf352d3769d334f6ba98e63c6bd615d6008959164f219e0873be6012ef167609f8aae7a5b645e9fc52a9d +AUX nsd.service 272 SHA256 1e3455791495082b122a67f25ff123728e5b87723c37935cd17f26333152b154 SHA512 fbca86887bfc36d61af06992cc98b3f3cb33c39274fbdc1e53d489bdcc767993911fab27a20244c3878b36bacbd1644a552364b2f7bf4d48e6eb247d0eecdf0f WHIRLPOOL 7d652e0db5fca5e277ccbbfed70bdcc1c291e6dcb4419a8cbe7b4db5502f3dd7e8f91ff0270c5c79bdb045b82cb010ee1b105029da7a24dd4b0070df647d24ac +AUX nsd3-patch.cron 275 SHA256 367075f702b62e5ba4a7b475ecd8a4c62dc1fd94a606fd6d896fcd222de9c6ee SHA512 9ec18c92d684ad4a5dba3e94e636727dd76ac28b31ded6ffd3812ec1cf6a447b587ec0d85a5b078fdff68b6dc25e0430c6add9fe4d5b1b2c3c3ebb1d0f659a69 WHIRLPOOL 525305e6317b837b7aaaf94a3d0865155df3e50a4f774ef2d4b118552ae6af56457542275c1295ab7fb03ce67b213d0f669fe59e7953577ebd5b0b359479a069 +AUX nsd3.initd-r1 1716 SHA256 64d3b0ff05423ca53e432f608fc428ac1e71daaa51855859805e0ce3b41b5ad1 SHA512 4785d1d26940fa98f7425f7958d26e1031a0ea9b7dd14ffae12865badc6e2a6e48be97923409d7c8d06bb93732df5cf952e93caf1aea786eebfe6fb2b56bd9f5 WHIRLPOOL 329fb18fd828758374b756df8bb69a58443190940346b0f0da5555d74ef1fb253bf8e6d5aeca79815251e49e5f13027da33188147c5ba3a201197252a9020f08 +AUX nsd_munin_.patch 615 SHA256 4600523d5b2c5f703a18c524d95a28839dbf717a32d764452c2fb93a9e238066 SHA512 c270601037fc43ab81c824181d1dc54894073c8879e469a0bd067abce62d174168633ac6d5a8636f44e85fc750e4bea1392debc3013b8c4f6cde2c2c5d686ac6 WHIRLPOOL 2d61acb5e6a6a131b29a993ad6f84e676375081104587cf1f9b3f309c23bfd14a69bf48be41e200de28bcb4641c10ef985047173a129ac2567d7d5c109a5bf0a +DIST nsd-4.1.6.tar.gz 1072173 SHA256 88f622055c95d38b9ef3723a240d1d0da35a28d09fe23b601015181a61d7775f SHA512 c9bd4901e49a718ef435862d55a9c351586ecd4349c52d39ee18acf6ca33e3488eb581115fe6a99d0a1fd975117168d2756866429fc517ebe4713a211811333d WHIRLPOOL 25a7e73b5504f153b30cd9a2f4e3a01cfd3ee7c328059066bff65abe73630fb08cc0643b9909f21bcd1d06ff67254751e298f92c3ac34d9696712f7dc63cab7c +EBUILD nsd-4.1.6.ebuild 2698 SHA256 b713068722e95e16da18122b46904a3e60ad19c1459aa7e1036d42fe5178c373 SHA512 f853bbb4725384cc994cbb2d9be1a1a87220efa209560bb8fd5948b6e9d6ddca38378f115c081655a5785c53cb4ce2b6da02de5480de4e0a2a34a49ac00f745c WHIRLPOOL a167778e12d9f0b455efd9dab37825d0122c683a00ed81e57435700afba3ab7c5fc566f69a8ed4212f0c22b3aca15aa86bc3adc346cf85130c3d2c9aa32dd62f diff --git a/net-dns/nsd/files/nsd.initd b/net-dns/nsd/files/nsd.initd new file mode 100644 index 0000000..b6eced7 --- /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 0000000..2fbec37 --- /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 0000000..8337557 --- /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/nsd_munin_.patch b/net-dns/nsd/files/nsd_munin_.patch new file mode 100644 index 0000000..96902f4 --- /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/nsd-4.1.6.ebuild b/net-dns/nsd/nsd-4.1.6.ebuild new file mode 100644 index 0000000..e2e5fc6 --- /dev/null +++ b/net-dns/nsd/nsd-4.1.6.ebuild @@ -0,0 +1,95 @@ +# Copyright 1999-2015 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 bind8-stats zone-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 +}