From 41b2fd1e4233c48d854968b309fd3fa342990fad Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Thu, 9 Jun 2011 14:20:16 +0000 Subject: testing/unbound: new aport ref #683 --- testing/unbound/APKBUILD | 52 +++++++++++++++++++++++++++++++++++++++++++ testing/unbound/unbound.confd | 4 ++++ testing/unbound/unbound.initd | 51 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 testing/unbound/APKBUILD create mode 100644 testing/unbound/unbound.confd create mode 100644 testing/unbound/unbound.initd (limited to 'testing') diff --git a/testing/unbound/APKBUILD b/testing/unbound/APKBUILD new file mode 100644 index 000000000..9ea50d652 --- /dev/null +++ b/testing/unbound/APKBUILD @@ -0,0 +1,52 @@ +# Contributor: Carlo Landmeter +# 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 000000000..b4de7cf11 --- /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 000000000..e9e902c9b --- /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 $? +} -- cgit v1.2.3