aboutsummaryrefslogtreecommitdiffstats
path: root/main/unbound
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-10-23 20:22:30 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-10-23 20:22:30 +0000
commit087c3e31555b102ce900c5a0b05cf4c5b185ee88 (patch)
treebc473d5a907e458fd8e6bec8caf759b137d42463 /main/unbound
parentcc7ab0ab786dc7c81d32fea69344cd5298c32c1d (diff)
downloadaports-087c3e31555b102ce900c5a0b05cf4c5b185ee88.tar.bz2
aports-087c3e31555b102ce900c5a0b05cf4c5b185ee88.tar.xz
main/unbound: moved from testing
Diffstat (limited to 'main/unbound')
-rw-r--r--main/unbound/APKBUILD78
-rw-r--r--main/unbound/unbound-1.4.12-gentoo.patch12
-rw-r--r--main/unbound/unbound.initd56
-rw-r--r--main/unbound/unbound.pre-install6
4 files changed, 152 insertions, 0 deletions
diff --git a/main/unbound/APKBUILD b/main/unbound/APKBUILD
new file mode 100644
index 0000000000..14dfbf23cf
--- /dev/null
+++ b/main/unbound/APKBUILD
@@ -0,0 +1,78 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=unbound
+pkgver=1.4.13
+pkgrel=1
+pkgdesc="Unbound is a validating, recursive, and caching DNS resolver"
+pkgusers="unbound"
+pkggroups="unbound"
+url="http://unbound.net/"
+arch="all"
+license="BSD"
+depends="dnssec-root"
+depends_dev="openssl-dev expat-dev ldns-dev libevent-dev"
+makedepends="$depends_dev python-dev swig"
+install="$pkgname.pre-install"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-libs py-unbound:py"
+source="http://unbound.net/downloads/unbound-$pkgver.tar.gz
+ unbound-1.4.12-gentoo.patch
+ unbound.initd"
+
+_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 \
+ --with-pidfile=/var/run/unbound/unbound.pid \
+ --with-username=unbound \
+ --with-libevent \
+ --with-ldns \
+ --with-pthreads \
+ --with-rootkey-file=/usr/share/dnssec/root-anchors.txt \
+ --disable-static \
+ --disable-rpath \
+ --with-ssl \
+ --with-pythonmodule \
+ --with-pyunbound \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ rm "$pkgdir"/usr/lib/*.la \
+ "$pkgdir"/usr/lib/python*/*/*.la || return 1
+ install -D contrib/update-anchor.sh \
+ "$pkgdir"/usr/share/$pkgname/update-anchor.sh \
+ || return 1
+ install -m755 -D "$srcdir"/unbound.initd \
+ "$pkgdir"/etc/init.d/unbound || return 1
+ install -d -o unbound -g unbound "$pkgdir"/var/run/unbound
+}
+
+libs() {
+ pkgdesc="unbound shared libraries"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/lib*.so.* "$subpkgdir"/usr/lib/
+}
+
+py() {
+ pkgdesc="Python bindings to libunbound"
+ mkdir -p "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
+}
+
+md5sums="7e3b27dee2b97640dd2e1783253317ab unbound-1.4.13.tar.gz
+a6d84d596e40da79fcd52529b7fb5046 unbound-1.4.12-gentoo.patch
+ebf2b5f8e1be2c4dbec9c5fad1e0e0de unbound.initd"
diff --git a/main/unbound/unbound-1.4.12-gentoo.patch b/main/unbound/unbound-1.4.12-gentoo.patch
new file mode 100644
index 0000000000..5792068978
--- /dev/null
+++ b/main/unbound/unbound-1.4.12-gentoo.patch
@@ -0,0 +1,12 @@
+diff -Naur unbound-1.4.12.orig/doc/example.conf.in unbound-1.4.12/doc/example.conf.in
+--- unbound-1.4.12.orig/doc/example.conf.in 2011-07-14 17:33:37.000000000 +0900
++++ unbound-1.4.12/doc/example.conf.in 2011-07-16 10:01:06.644402341 +0900
+@@ -334,7 +334,7 @@
+ # with several entries, one file per entry.
+ # Zone file format, with DS and DNSKEY entries.
+ # Note this gets out of date, use auto-trust-anchor-file please.
+- # trust-anchor-file: ""
++ # trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
+
+ # Trusted key for validation. DS or DNSKEY. specify the RR on a
+ # single line, surrounded by "". TTL is ignored. class is IN default.
diff --git a/main/unbound/unbound.initd b/main/unbound/unbound.initd
new file mode 100644
index 0000000000..90deb23e4a
--- /dev/null
+++ b/main/unbound/unbound.initd
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2011 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.2 2011/09/13 15:14:49 matsuu Exp $
+
+name="unbound daemon"
+extra_commands="configtest"
+extra_started_commands="reload"
+description="unbound is a Domain Name Server (DNS) that is used to resolve host names to IP address."
+description_configtest="Run syntax tests for configuration files only."
+description_reload="Kills all children and reloads the configuration."
+
+
+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 $?
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+start() {
+ checkconfig || return $?
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --pidfile "${UNBOUND_PIDFILE}" \
+ --exec "${UNBOUND_BINARY}" -- -c "${UNBOUND_CONFFILE}"
+ eend $?
+}
+
+stop() {
+ checkconfig || return $?
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile "${UNBOUND_PIDFILE}"
+ eend $?
+}
+
+reload() {
+ checkconfig || return $?
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile "${UNBOUND_PIDFILE}"
+ eend $?
+}
diff --git a/main/unbound/unbound.pre-install b/main/unbound/unbound.pre-install
new file mode 100644
index 0000000000..015ba3c52f
--- /dev/null
+++ b/main/unbound/unbound.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S unbound 2>/dev/null
+adduser -S -s /bin/false -D -H -h /etc/unbound -G unbound \
+ -g "Unbound user" unbound 2>/dev/null
+exit 0