summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Ressel <aranea@aixah.de>2019-01-29 10:11:57 +0100
committerLuis Ressel <aranea@aixah.de>2019-01-29 13:46:09 +0100
commit5665ae7639f810569fd229749371f8ec8bb1eb4c (patch)
treea7e5b0830430681181d2b72d65cf1d291c3422bc
parent38abc8ab60bb141792bfca8c4df7a899e3810acb (diff)
downloadpackages-5665ae7639f810569fd229749371f8ec8bb1eb4c.tar.gz
packages-5665ae7639f810569fd229749371f8ec8bb1eb4c.tar.bz2
packages-5665ae7639f810569fd229749371f8ec8bb1eb4c.tar.xz
packages-5665ae7639f810569fd229749371f8ec8bb1eb4c.zip
user/unbound: New package
-rw-r--r--user/unbound/APKBUILD76
-rw-r--r--user/unbound/unbound.confd5
-rw-r--r--user/unbound/unbound.initd16
-rwxr-xr-xuser/unbound/unbound.pre-install5
4 files changed, 102 insertions, 0 deletions
diff --git a/user/unbound/APKBUILD b/user/unbound/APKBUILD
new file mode 100644
index 000000000..aecfea4f6
--- /dev/null
+++ b/user/unbound/APKBUILD
@@ -0,0 +1,76 @@
+# Contributor: Luis Ressel <aranea@aixah.de>
+# Maintainer: Luis Ressel <aranea@aixah.de>
+pkgname=unbound
+pkgver=1.8.3
+pkgrel=0
+pkgdesc="A validating, recursive and caching DNS resolver"
+url="https://unbound.net/"
+arch="all"
+options="!checkroot"
+license="BSD-3-Clause"
+depends=""
+makedepends="expat-dev libevent-dev openssl-dev python3-dev swig"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc $pkgname-python"
+install="$pkgname.pre-install"
+pkgusers="unbound"
+pkggroups="unbound"
+source="https://nlnetlabs.nl/downloads/$pkgname/$pkgname-$pkgver.tar.gz
+ unbound.confd
+ unbound.initd"
+
+build() {
+ cd "$builddir"
+
+ # cachedb, dnscrypt and dnstap have yet unpackaged dependencies
+ PYTHON_VERSION=3 ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --disable-rpath \
+ --with-rootkey-file=/etc/unbound/var/root.key \
+ --with-pidfile=/run/unbound.pid \
+ --enable-tfo-client \
+ --enable-tfo-server \
+ --disable-cachedb \
+ --disable-dnscrypt \
+ --disable-dnstap \
+ --enable-ipsecmod \
+ --enable-subnet \
+ --with-pthreads \
+ --with-pyunbound \
+ --without-pythonmodule \
+ --with-ssl=/usr \
+ --with-libevent=/usr \
+ --with-libexpat=/usr
+ make
+}
+
+check() {
+ cd "$builddir"
+ sed -i -e 's/ELAPSED/ELAPSE/' testdata/auth_xfr_notify.rpl # Bug in unbound-1.8.3 test suite
+ make test
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ install -do unbound "$pkgdir/etc/unbound/var"
+}
+
+openrc() {
+ default_openrc
+ install -Dm755 "$srcdir/unbound.initd" "$subpkgdir/etc/init.d/unbound"
+ install -Dm644 "$srcdir/unbound.confd" "$subpkgdir/etc/conf.d/unbound"
+}
+
+python() {
+ pkgdesc="$pkgdesc (Python bindings)"
+
+ install -d "$subpkgdir/usr/lib"
+ mv "$pkgdir/usr/lib/python"* "$subpkgdir"
+}
+
+sha512sums="545486ccce288a6ef1937d82653a43a11dbd3aec7b8d0036e7fd107e537cdfc935def9db9178c2eb418d6f4b0849a242a0be1dea966f3e9e0145aa7266e483ad unbound-1.8.3.tar.gz
+de9dc269553f5449c1757690c2a8a3b9f228964f5672d721cfdbc29e6fab8954907fa4fa3761dd6f705b3ccd2f729cc6e2fe870107feb68cca611589f8306b94 unbound.confd
+6627cbcbcb4e04f596e7e0ffdbf80ceb54cdb59144cb89896e53503dfb41b99fd77d8b85d05e6670f77023b6eafec8885b00c0c8e4e34e3e638c52c037a7985e unbound.initd"
diff --git a/user/unbound/unbound.confd b/user/unbound/unbound.confd
new file mode 100644
index 000000000..ce468e95c
--- /dev/null
+++ b/user/unbound/unbound.confd
@@ -0,0 +1,5 @@
+#
+# Specify daemon options here.
+#
+
+unbound_opts=""
diff --git a/user/unbound/unbound.initd b/user/unbound/unbound.initd
new file mode 100644
index 000000000..0ffc19aba
--- /dev/null
+++ b/user/unbound/unbound.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+
+name="unbound"
+command="/usr/sbin/unbound"
+command_args="${unbound_opts}"
+pidfile="/run/unbound.pid"
+extra_started_commands="reload"
+
+depend() {
+ use logger net
+ provide dns
+}
+
+reload() {
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+}
diff --git a/user/unbound/unbound.pre-install b/user/unbound/unbound.pre-install
new file mode 100755
index 000000000..9f203cb08
--- /dev/null
+++ b/user/unbound/unbound.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+groupadd -r unbound 2>/dev/null
+useradd -M -N -g unbound -r -s /sbin/nologin -d /etc/unbound unbound 2>/dev/null
+exit 0