From 4714cec7e8367a7618b168d0db4bc085dbfaac8a Mon Sep 17 00:00:00 2001 From: root Date: Mon, 11 Jun 2012 00:02:18 +0000 Subject: Mon Jun 11 00:02:18 UTC 2012 --- staging/bind/127.0.0.zone | 11 ++++++ staging/bind/PKGBUILD | 86 +++++++++++++++++++++++++++++++++++++++++ staging/bind/install | 21 ++++++++++ staging/bind/localhost.zone | 10 +++++ staging/bind/named | 52 +++++++++++++++++++++++++ staging/bind/named.conf | 64 ++++++++++++++++++++++++++++++ staging/bind/named.conf.d | 4 ++ staging/bind/named.logrotate | 6 +++ staging/bind/named.service | 10 +++++ staging/bind/remove-tools.patch | 12 ++++++ 10 files changed, 276 insertions(+) create mode 100644 staging/bind/127.0.0.zone create mode 100644 staging/bind/PKGBUILD create mode 100644 staging/bind/install create mode 100644 staging/bind/localhost.zone create mode 100755 staging/bind/named create mode 100644 staging/bind/named.conf create mode 100644 staging/bind/named.conf.d create mode 100644 staging/bind/named.logrotate create mode 100644 staging/bind/named.service create mode 100644 staging/bind/remove-tools.patch (limited to 'staging/bind') diff --git a/staging/bind/127.0.0.zone b/staging/bind/127.0.0.zone new file mode 100644 index 000000000..509c311f6 --- /dev/null +++ b/staging/bind/127.0.0.zone @@ -0,0 +1,11 @@ +$ORIGIN 0.0.127.in-addr.arpa. + +@ 1D IN SOA localhost. root.localhost. ( + 42 ; serial (yyyymmdd##) + 3H ; refresh + 15M ; retry + 1W ; expiry + 1D ) ; minimum ttl + + 1D IN NS localhost. +1 1D IN PTR localhost. diff --git a/staging/bind/PKGBUILD b/staging/bind/PKGBUILD new file mode 100644 index 000000000..99bbd00d4 --- /dev/null +++ b/staging/bind/PKGBUILD @@ -0,0 +1,86 @@ +# $Id: PKGBUILD 161312 2012-06-09 06:22:34Z bisson $ +# Maintainer: Gaetan Bisson +# Contributor: judd +# Contributor: Mario Vazquez + +pkgname=bind + +# Use a period and not a hyphen before the patch level for proper versioning. +pkgver=9.9.1.P1 +_pkgver=9.9.1-P1 +pkgrel=2 + +pkgdesc='Berkeley Internet Name Daemon is the reference implementation of the DNS protocols' +url='http://www.isc.org/software/bind/' +license=('custom:ISC') +arch=('i686' 'x86_64') +options=('!makeflags' '!libtool') +depends=('openssl' 'krb5' 'libxml2') +source=("http://ftp.isc.org/isc/bind9/${_pkgver}/bind-${_pkgver}.tar.gz" + 'root.hint::http://www.internic.net/zones/named.root' + 'remove-tools.patch' + 'named' + 'named.conf' + 'named.conf.d' + 'named.service' + 'named.logrotate' + 'localhost.zone' + '127.0.0.zone') +sha1sums=('a2263b96ccd8a143ea54b39958142c542bf605a8' + 'cbdecd1ea8e7b612b33b63d66bc57273795d1f54' + '18f477f510df31e6c6f547ee2d5fc46e973479bf' + '46232e9db243c6c05e170a1781d7a7f413be5d03' + '5ca7a5f2a132548a090a045a2df3acea6b35d9eb' + '7848edbfb9a848843f57c11c02b0289eefd42d00' + '05fb2346a30dee2f99c40914dd23708729839b64' + '9ffb5c3f72390a517aeae557e32349d5d278cb63' + '76a0d4cd1b913db177a5a375bebc47e5956866ec' + '53be0f1437ebe595240d8dbdd819939582b97fb9') + +provides=('dns-server') + +install=install +backup=('etc/logrotate.d/named' + 'etc/conf.d/named' + 'etc/named.conf') + +build() { + cd "${srcdir}/bind-${_pkgver}" + + patch -p1 -i ../remove-tools.patch + + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-static \ + --disable-linux-caps \ + --with-openssl \ + --with-libxml2 \ + --with-libtool \ + + make +} + +package() { + cd "${srcdir}/bind-${_pkgver}" + + install -Dm644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + make DESTDIR="${pkgdir}" install + + rmdir "${pkgdir}/var/run" + install -d "${pkgdir}"/usr/share/doc/bind + install doc/arm/*.html "${pkgdir}"/usr/share/doc/bind + + install -D -m755 ../named "${pkgdir}"/etc/rc.d/named + install -D -m644 ../named.conf.d "${pkgdir}"/etc/conf.d/named + install -D -m644 ../named.service "${pkgdir}"/usr/lib/systemd/system/named.service + install -D -m600 ../named.logrotate "${pkgdir}"/etc/logrotate.d/named + install -D -m640 -o 0 -g 40 ../named.conf "${pkgdir}"/etc/named.conf + + install -d -m750 -o 0 -g 40 "${pkgdir}"/var/named + install -m640 -o 0 -g 40 ../root.hint "${pkgdir}"/var/named + install -m640 -o 0 -g 40 ../127.0.0.zone "${pkgdir}"/var/named + install -m640 -o 0 -g 40 ../localhost.zone "${pkgdir}"/var/named +} diff --git a/staging/bind/install b/staging/bind/install new file mode 100644 index 000000000..287d0e05b --- /dev/null +++ b/staging/bind/install @@ -0,0 +1,21 @@ +post_install() { + getent group named &>/dev/null || groupadd -g 40 named + getent passwd named &>/dev/null || useradd -u 40 -c "BIND DNS Server" -g named -d /var/named -s /bin/false named + passwd -l named &>/dev/null + + touch var/log/named.log + chown named:named var/log/named.log + + # create an rndc.key if it doesn't already exist + if [[ ! -s etc/rndc.key ]]; then + usr/sbin/rndc-confgen -r /dev/urandom -b 256 | head -n 5 >>etc/rndc.key + chown root:named etc/rndc.key + chmod 640 etc/rndc.key + fi +} + +pre_remove() { + getent passwd named &>/dev/null && userdel named >/dev/null + getent group named &>/dev/null && groupdel named >/dev/null + return 0 +} diff --git a/staging/bind/localhost.zone b/staging/bind/localhost.zone new file mode 100644 index 000000000..e3ff9641c --- /dev/null +++ b/staging/bind/localhost.zone @@ -0,0 +1,10 @@ +$ORIGIN localhost. +@ 1D IN SOA @ root ( + 42 ; serial (yyyymmdd##) + 3H ; refresh + 15M ; retry + 1W ; expiry + 1D ) ; minimum ttl + + 1D IN NS @ + 1D IN A 127.0.0.1 diff --git a/staging/bind/named b/staging/bind/named new file mode 100755 index 000000000..7907f9983 --- /dev/null +++ b/staging/bind/named @@ -0,0 +1,52 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/named + +[[ -d /var/run/named ]] || mkdir -p /var/run/named +chown named:named /var/run/named + +PIDFILE=/var/run/named/named.pid +PID=$(cat $PIDFILE 2>/dev/null) +readlink -q /proc/$PID/exe | grep -q '^/usr/sbin/named' || { PID=; rm $PIDFILE 2>/dev/null; } + +case "$1" in + start) + stat_busy "Starting BIND" + [ -z "$PID" ] && /usr/sbin/named ${NAMED_ARGS} + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon named + stat_done + fi + ;; + stop) + stat_busy "Stopping BIND" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon named + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + reload) + stat_busy "Reloading BIND" + [ ! -z "$PID" ] && rndc reload &>/dev/null || kill -HUP $PID &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + ;; + *) + echo "usage: $0 {start|stop|reload|restart}" +esac +exit 0 diff --git a/staging/bind/named.conf b/staging/bind/named.conf new file mode 100644 index 000000000..38fb12cbe --- /dev/null +++ b/staging/bind/named.conf @@ -0,0 +1,64 @@ +// +// /etc/named.conf +// + +options { + directory "/var/named"; + pid-file "/var/run/named/named.pid"; + auth-nxdomain yes; + datasize default; +// Uncomment these to enable IPv6 connections support +// IPv4 will still work: +// listen-on-v6 { any; }; +// Add this for no IPv4: +// listen-on { none; }; + + // Default security settings. + allow-recursion { 127.0.0.1; }; + allow-transfer { none; }; + allow-update { none; }; + version none; + hostname none; + server-id none; +}; + +zone "localhost" IN { + type master; + file "localhost.zone"; + allow-transfer { any; }; +}; + +zone "0.0.127.in-addr.arpa" IN { + type master; + file "127.0.0.zone"; + allow-transfer { any; }; +}; + +zone "." IN { + type hint; + file "root.hint"; +}; + +//zone "example.org" IN { +// type slave; +// file "example.zone"; +// masters { +// 192.168.1.100; +// }; +// allow-query { any; }; +// allow-transfer { any; }; +//}; + +logging { + channel xfer-log { + file "/var/log/named.log"; + print-category yes; + print-severity yes; + print-time yes; + severity info; + }; + category xfer-in { xfer-log; }; + category xfer-out { xfer-log; }; + category notify { xfer-log; }; +}; + diff --git a/staging/bind/named.conf.d b/staging/bind/named.conf.d new file mode 100644 index 000000000..aecbd2307 --- /dev/null +++ b/staging/bind/named.conf.d @@ -0,0 +1,4 @@ +# +# Parameters to be passed to BIND +# +NAMED_ARGS="-u named" diff --git a/staging/bind/named.logrotate b/staging/bind/named.logrotate new file mode 100644 index 000000000..ef1a2d032 --- /dev/null +++ b/staging/bind/named.logrotate @@ -0,0 +1,6 @@ +/var/log/named.log { + missingok + postrotate + /bin/kill -HUP `cat /var/run/named/named.pid 2>/dev/null` 2>/dev/null || true + endscript +} diff --git a/staging/bind/named.service b/staging/bind/named.service new file mode 100644 index 000000000..77196f785 --- /dev/null +++ b/staging/bind/named.service @@ -0,0 +1,10 @@ +[Unit] +Description=Internet domain name server + +[Service] +ExecStart=/usr/sbin/named -f -u named +ExecReload=/usr/sbin/rndc reload +ExecStop=/usr/sbin/rndc stop + +[Install] +WantedBy=multi-user.target diff --git a/staging/bind/remove-tools.patch b/staging/bind/remove-tools.patch new file mode 100644 index 000000000..cbd1c53ad --- /dev/null +++ b/staging/bind/remove-tools.patch @@ -0,0 +1,12 @@ +diff -aur old/bin/Makefile.in new/bin/Makefile.in +--- old/bin/Makefile.in 2009-10-05 05:07:08.000000000 -0700 ++++ new/bin/Makefile.in 2011-08-28 19:14:17.025674400 -0700 +@@ -19,7 +19,7 @@ + VPATH = @srcdir@ + top_srcdir = @top_srcdir@ + +-SUBDIRS = named rndc dig dnssec tests tools nsupdate \ ++SUBDIRS = named rndc dnssec tests tools nsupdate \ + check confgen @PKCS11_TOOLS@ + TARGETS = + -- cgit v1.2.3-54-g00ecf