aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2011-06-09 14:20:16 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2011-06-09 14:20:16 +0000
commit41b2fd1e4233c48d854968b309fd3fa342990fad (patch)
tree2e12400c23ddd4487d202854aca0e531eb6bf580
parente05b4596e175797c77c673d90e8f43d5d060780e (diff)
testing/unbound: new aport
ref #683
-rw-r--r--testing/unbound/APKBUILD52
-rw-r--r--testing/unbound/unbound.confd4
-rw-r--r--testing/unbound/unbound.initd51
3 files changed, 107 insertions, 0 deletions
diff --git a/testing/unbound/APKBUILD b/testing/unbound/APKBUILD
new file mode 100644
index 00000000000..9ea50d65294
--- /dev/null
+++ b/testing/unbound/APKBUILD
@@ -0,0 +1,52 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=unbound
+pkgver=1.4.10
+pkgrel=0
+pkgdesc="Unbound is a validating, recursive, and caching DNS resolver"
+url="http://unbound.net/"
+arch="all"
+license="Custom"
+depends=
+depends_dev="openssl-dev expat-dev ldns-dev"
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://unbound.net/downloads/unbound-$pkgver.tar.gz
+unbound.initd
+unbound.confd"
+
+_builddir="$srcdir"/unbound-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ install -m755 -D "$srcdir"/unbound.initd \
+ "$pkgdir"/etc/init.d/unbound || return 1
+ install -m644 -D "$srcdir"/unbound.confd \
+ "$pkgdir"/etc/conf.d/unbound || return 1
+}
+
+md5sums="6bbae378db76abfe0bd72c404e484597 unbound-1.4.10.tar.gz
+941663107bfd428f54d2cad11b0cefc9 unbound.initd
+10f8a73d14160571acea41fc89d914e7 unbound.confd"
diff --git a/testing/unbound/unbound.confd b/testing/unbound/unbound.confd
new file mode 100644
index 00000000000..b4de7cf1142
--- /dev/null
+++ b/testing/unbound/unbound.confd
@@ -0,0 +1,4 @@
+# Settings should normally not need any changes.
+
+# Location of the unbound configuration file. Leave empty for the default.
+#UNBOUND_CONFFILE="/etc/unbound/unbound.conf"
diff --git a/testing/unbound/unbound.initd b/testing/unbound/unbound.initd
new file mode 100644
index 00000000000..e9e902c9b9c
--- /dev/null
+++ b/testing/unbound/unbound.initd
@@ -0,0 +1,51 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dns/unbound/files/unbound.initd,v 1.1 2009/11/22 16:57:33 matsuu Exp $
+
+opts="${opts} checkconfig reload"
+
+UNBOUND_BINARY=${UNBOUND_BINARY:-/usr/sbin/unbound}
+UNBOUND_CHECKCONF=${UNBOUND_CHECKCONF:-/usr/sbin/unbound-checkconf}
+UNBOUND_CONFFILE=${UNBOUND_CONFFILE:-/etc/unbound/${SVCNAME}.conf}
+
+depend() {
+ need net
+ use logger
+ provide dns
+ after auth-dns
+}
+
+checkconfig() {
+ UNBOUND_PIDFILE=$("${UNBOUND_CHECKCONF}" -o pidfile "${UNBOUND_CONFFILE}")
+ return $?
+}
+
+start() {
+ checkconfig || return $?
+ ebegin "Starting unbound"
+ start-stop-daemon --start --pidfile "${UNBOUND_PIDFILE}" \
+ --exec "${UNBOUND_BINARY}" -- -c "${UNBOUND_CONFFILE}"
+ eend $?
+}
+
+stop() {
+ checkconfig || return $?
+ ebegin "Stopping unbound"
+ start-stop-daemon --stop --pidfile "${UNBOUND_PIDFILE}"
+ eend $?
+}
+
+restart() {
+ checkconfig || return $?
+ svc_stop
+ svc_start
+}
+
+reload() {
+ checkconfig || return $?
+ ebegin "Reloading unbound"
+ start-stop-daemon --stop --pidfile "${UNBOUND_PIDFILE}" \
+ --signal HUP --oknodo
+ eend $?
+}