aboutsummaryrefslogtreecommitdiffstats
path: root/main/bind
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-03-13 10:36:52 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-13 12:08:59 +0000
commit6bda80b11fede03e7e255f552d6598bb7910fe5f (patch)
tree0849065daee279d121d0840692ceaed1f41762ae /main/bind
parent87104a6ecd305a72e669da977abe4ab1f19c7fc5 (diff)
downloadaports-6bda80b11fede03e7e255f552d6598bb7910fe5f.tar.bz2
aports-6bda80b11fede03e7e255f552d6598bb7910fe5f.tar.xz
main/bind: upgrade to 9.9.0
Diffstat (limited to 'main/bind')
-rw-r--r--main/bind/APKBUILD41
-rw-r--r--main/bind/bind.confd10
-rw-r--r--main/bind/bind.initd79
-rw-r--r--main/bind/bind.post-install5
-rw-r--r--main/bind/bind.pre-install3
5 files changed, 105 insertions, 33 deletions
diff --git a/main/bind/APKBUILD b/main/bind/APKBUILD
index 994d3718e5..c2c81775fd 100644
--- a/main/bind/APKBUILD
+++ b/main/bind/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=bind
-pkgver=9.8.1_p1
+pkgver=9.9.0
_ver=${pkgver%_p*}
_p=${pkgver#*_p}
[ "$_p" != "$pkgver" ] && _ver="${_ver}-P$_p"
@@ -11,8 +11,10 @@ url="http://www.isc.org"
arch="all"
license="as-is"
depends=
+pkgusers="named"
+pkggroups="named"
makedepends="openssl-dev perl"
-install="$pkgname.pre-install $pkgname.post-install"
+install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-tools"
source="http://ftp.isc.org/isc/bind9/${_ver}/bind-${_ver}.tar.gz
bind.so_bsdcompat.patch
@@ -66,16 +68,31 @@ build() {
package() {
cd "$_builddir"
+ install -d -m0770 -g named -o root "$pkgdir"/var/bind \
+ "$pkgdir"/var/bind/sec \
+ "$pkgdir"/var/bind/dyn \
+ "$pkgdir"/var/run/named \
+ "$pkgdir"/var/log/named \
+ || return 1
+
+ install -d -m0750 -g named -o root "$pkgdir"/etc/bind \
+ "$pkgdir"/var/bind/pri || return 1
+
make DESTDIR="$pkgdir" install || return 1
rm "$pkgdir"/usr/lib/*.la || return 1
- install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/named || return 1
- install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/named || return 1
- install -Dm644 "$srcdir"/$pkgname.conf "$pkgdir"/etc/bind/named.conf || return 1
- install -Dm644 "$srcdir"/$pkgname.named.ca "$pkgdir"/var/bind/named.ca || return 1
- install -Dm644 "$srcdir"/$pkgname.127.zone "$pkgdir"/var/bind/pri/127.zone || return 1
- install -Dm644 "$srcdir"/$pkgname.localhost.zone "$pkgdir"/var/bind/pri/localhost.zone || return 1
- mkdir -p "$pkgdir"/var/bind/sec || return 1
+ install -Dm755 "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/named || return 1
+ install -Dm644 "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/named || return 1
+ install -Dm644 "$srcdir"/$pkgname.conf \
+ "$pkgdir"/etc/bind/named.conf || return 1
+ install -Dm644 "$srcdir"/$pkgname.named.ca \
+ "$pkgdir"/var/bind/named.ca || return 1
+ install -Dm644 "$srcdir"/$pkgname.127.zone \
+ "$pkgdir"/var/bind/pri/127.zone || return 1
+ install -Dm644 "$srcdir"/$pkgname.localhost.zone \
+ "$pkgdir"/var/bind/pri/localhost.zone || return 1
cd "$pkgdir"/var/bind
ln -s named.ca root.cache || return 1
}
@@ -95,10 +112,10 @@ tools() {
done
}
-md5sums="afa41f8203d50bedad65071f9b6f96d7 bind-9.8.1-P1.tar.gz
+md5sums="9281d0b04f711d28153ba1ab04a54026 bind-9.9.0.tar.gz
f270a5b0a28ab6e818840c5c368ddbcc bind.so_bsdcompat.patch
-92914193cc603d8d81ef00534ce9c1c9 bind.initd
-8b05a287976d66d51c18b73ee7523671 bind.confd
+da52267d5d56317d08c0fb170fc14da8 bind.initd
+418a367cecfdf8760c92235d3967867e bind.confd
be5fd752bdbd59385f2a559d603098d5 bind.conf
a7455b009b7fccd74ac6f6eaa6902a00 bind.127.zone
c3220168fabfb31a25e8c3a545545e34 bind.localhost.zone
diff --git a/main/bind/bind.confd b/main/bind/bind.confd
index 82d3763509..a9af5676f7 100644
--- a/main/bind/bind.confd
+++ b/main/bind/bind.confd
@@ -2,13 +2,7 @@
OPTS=""
# Set this to the number of processors you have.
-CPU="1"
-
-# User which named should run as
-USER="named"
-
-# Default pid file location
-PIDFILE="/var/run/named/named.pid"
+# CPU="1"
# Scheduling priority: 19 is the lowest and -20 is the highest.
-NICELEVEL="0"
+# NICELEVEL="0"
diff --git a/main/bind/bind.initd b/main/bind/bind.initd
index 3284ec853a..fa9ffb3434 100644
--- a/main/bind/bind.initd
+++ b/main/bind/bind.initd
@@ -1,7 +1,15 @@
#!/sbin/runscript
-NAME=named
-DAEMON=/usr/sbin/$NAME
+extra_commands="checkconfig checkzones"
+extra_started_commands="reload"
+
+depend() {
+ need net
+ use logger
+ provide dns
+}
+
+: ${NAMED_CONF:=/etc/bind/named.conf}
depend() {
need net
@@ -10,16 +18,73 @@ depend() {
provide dns
}
+_get_pidfile() {
+ [ -n "${PIDFILE}" ] || PIDFILE=$(\
+ /usr/sbin/named-checkconf -p ${NAMED_CONF} | grep 'pid-file' | cut -d\" -f2)
+ [ -z "${PIDFILE}" ] && PIDFILE=/var/run/named/named.pid
+}
+
+checkconfig() {
+ ebegin "Checking named configuration"
+
+ if [ ! -f "${NAMED_CONF}" ] ; then
+ eerror "No ${NAMED_CONF} file exists!"
+ return 1
+ fi
+
+ /usr/sbin/named-checkconf ${NAMED_CONF} || {
+ eerror "named-checkconf failed! Please fix your config first."
+ return 1
+ }
+ eend 0
+ return 0
+}
+
+checkzones() {
+ ebegin "Checking named configuration and zones"
+ /usr/sbin/named-checkconf -z -j ${NAMED_CONF}
+ eend $?
+}
+
start() {
- ebegin "Starting ${NAME}"
- start-stop-daemon --start --quiet --background \
- --exec ${DAEMON} --nicelevel ${NICELEVEL} \
- -- -u ${USER} -n ${CPU} ${OPTS}
+ local piddir
+ ebegin "Starting named"
+ _get_pidfile
+ piddir="${PIDFILE%/*}"
+ if [ ! -d "${piddir}" ]; then
+ checkpath -q -d -o root:named -m 0770 "${piddir}" || {
+ eend 1
+ return 1
+ }
+ fi
+
+ checkconfig || { eend 1; return 1; }
+
+ # create piddir (usually /var/run/named) if necessary, bug 334535
+ _get_pidfile
+ piddir="${PIDFILE%/*}"
+ if [ ! -d "${piddir}" ]; then
+ checkpath -q -d -o root:named -m 0770 "${piddir}" || {
+ eend 1
+ return 1
+ }
+ fi
+
+ # In case someone have $CPU set in /etc/conf.d/named
+ if [ -n "${CPU}" ] && [ "${CPU}" -gt 0 ]; then
+ CPU="-n ${CPU}"
+ fi
+
+ start-stop-daemon --start --pidfile ${PIDFILE} \
+ --nicelevel ${NICELEVEL:-0} \
+ --exec /usr/sbin/named \
+ -- -u named ${CPU} ${OPTS}
eend $?
}
stop() {
- ebegin "Stopping ${NAME}"
+ ebegin "Stopping named"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
eend $?
}
+
diff --git a/main/bind/bind.post-install b/main/bind/bind.post-install
deleted file mode 100644
index 7e091c097c..0000000000
--- a/main/bind/bind.post-install
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-install -dD -o named -g named /var/run/named
-chown -R named:named /var/bind
-
diff --git a/main/bind/bind.pre-install b/main/bind/bind.pre-install
index c799634502..e0a615ef08 100644
--- a/main/bind/bind.pre-install
+++ b/main/bind/bind.pre-install
@@ -1,5 +1,6 @@
#!/bin/sh
-adduser -h /etc/bind -s /bin/false -D named 2>/dev/null
+addgroup -S named 2>/dev/null
+adduser -h /etc/bind -s /bin/false -G named -D named 2>/dev/null
exit 0