summaryrefslogtreecommitdiff
path: root/community-testing/unbound
diff options
context:
space:
mode:
Diffstat (limited to 'community-testing/unbound')
-rw-r--r--community-testing/unbound/PKGBUILD54
-rw-r--r--community-testing/unbound/install10
-rw-r--r--community-testing/unbound/rc.d39
-rw-r--r--community-testing/unbound/unbound.conf4
-rw-r--r--community-testing/unbound/unbound.service11
5 files changed, 118 insertions, 0 deletions
diff --git a/community-testing/unbound/PKGBUILD b/community-testing/unbound/PKGBUILD
new file mode 100644
index 000000000..cefb077c0
--- /dev/null
+++ b/community-testing/unbound/PKGBUILD
@@ -0,0 +1,54 @@
+# $Id: PKGBUILD 78747 2012-10-23 22:58:34Z bisson $
+# Maintainer: Gaetan Bisson <bisson@archlinux.org>
+# Contributor: Hisato Tatekura <hisato_tatekura@excentrics.net>
+# Contributor: Massimiliano Torromeo <massimiliano DOT torromeo AT google mail service>
+
+pkgname=unbound
+pkgver=1.4.18
+pkgrel=2
+pkgdesc='Validating, recursive, and caching DNS resolver'
+url='http://unbound.net/'
+license=('custom:BSD')
+arch=('i686' 'x86_64')
+options=('!libtool')
+depends=('openssl' 'ldns')
+makedepends=('expat')
+optdepends=('expat: unbound-anchor')
+backup=('etc/unbound/unbound.conf')
+source=("http://unbound.net/downloads/${pkgname}-${pkgver}.tar.gz"
+ 'unbound.service'
+ 'unbound.conf'
+ 'rc.d')
+sha1sums=('b64b4c9f7981df4e7589ebb770a31352a09db3fb'
+ '5bc313cd978e4d6efe8c13600e838c70629be477'
+ '5d473ec2943fd85367cdb653fcd58e186f07383f'
+ 'dc96e772f467b32555df21d16fdb15e98194c228')
+
+install=install
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --enable-static=no \
+ --disable-rpath \
+ --with-conf-file=/etc/unbound/unbound.conf \
+ --with-pidfile=/run/unbound.pid \
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}" install
+
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -D -m755 ../rc.d "${pkgdir}/etc/rc.d/${pkgname}"
+ install -D -m644 ../unbound.conf "${pkgdir}/etc/unbound/unbound.conf"
+ install -D -m644 doc/example.conf.in "${pkgdir}/etc/unbound/unbound.conf.example"
+ install -D -m644 ../unbound.service "${pkgdir}/usr/lib/systemd/system/unbound.service"
+}
diff --git a/community-testing/unbound/install b/community-testing/unbound/install
new file mode 100644
index 000000000..964792592
--- /dev/null
+++ b/community-testing/unbound/install
@@ -0,0 +1,10 @@
+post_install() {
+ getent group unbound &>/dev/null || groupadd -r unbound >/dev/null
+ getent passwd unbound &>/dev/null || useradd -r -g unbound -d /etc/unbound -s /bin/false -c unbound unbound >/dev/null
+}
+
+post_remove() {
+ getent passwd unbound &>/dev/null && userdel unbound >/dev/null
+ getent group unbound &>/dev/null && groupdel unbound >/dev/null
+ return 0
+}
diff --git a/community-testing/unbound/rc.d b/community-testing/unbound/rc.d
new file mode 100644
index 000000000..b5b6466de
--- /dev/null
+++ b/community-testing/unbound/rc.d
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+name=unbound
+prog="/usr/sbin/unbound"
+
+PID=$(pidof -o %PPID $prog)
+
+case "$1" in
+start)
+ stat_busy "Starting $name daemon"
+ [[ -z "$PID" ]] && eval $prog &>/dev/null \
+ && { add_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+stop)
+ stat_busy "Stopping $name daemon"
+ [[ -n "$PID" ]] && kill $PID &>/dev/null \
+ && { rm_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+reload)
+ stat_busy "Reloading $name daemon"
+ [[ -n "$PID" ]] && kill -SIGHUP $PID &>/dev/null \
+ && { stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+*)
+ echo "usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
diff --git a/community-testing/unbound/unbound.conf b/community-testing/unbound/unbound.conf
new file mode 100644
index 000000000..445bceff1
--- /dev/null
+++ b/community-testing/unbound/unbound.conf
@@ -0,0 +1,4 @@
+server:
+ username: "unbound"
+ directory: "/etc/unbound"
+ use-syslog: yes
diff --git a/community-testing/unbound/unbound.service b/community-testing/unbound/unbound.service
new file mode 100644
index 000000000..8b3c9576b
--- /dev/null
+++ b/community-testing/unbound/unbound.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Unbound DNS Resolver
+
+[Service]
+PIDFile=/run/unbound.pid
+ExecStart=/usr/sbin/unbound -d
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=always
+
+[Install]
+WantedBy=multi-user.target