summaryrefslogtreecommitdiff
path: root/community/unbound
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/unbound
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/unbound')
-rw-r--r--community/unbound/PKGBUILD46
-rw-r--r--community/unbound/install18
-rw-r--r--community/unbound/rc.d33
-rw-r--r--community/unbound/unbound.conf4
4 files changed, 101 insertions, 0 deletions
diff --git a/community/unbound/PKGBUILD b/community/unbound/PKGBUILD
new file mode 100644
index 000000000..b68c81348
--- /dev/null
+++ b/community/unbound/PKGBUILD
@@ -0,0 +1,46 @@
+# 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.9
+pkgrel=1
+pkgdesc='Validating, recursive, and caching DNS resolver'
+arch=('i686' 'x86_64')
+url='http://unbound.net/'
+license=('custom:BSD')
+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.conf'
+ 'rc.d')
+sha1sums=('f2ac7b4ef1d1b330e2dd5e2eedeb6fd2bbad8478'
+ '5d473ec2943fd85367cdb653fcd58e186f07383f'
+ 'a0c8c496d71d43ed9e09b170d3df836dfb096480')
+
+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=/var/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"
+}
diff --git a/community/unbound/install b/community/unbound/install
new file mode 100644
index 000000000..34e7026d1
--- /dev/null
+++ b/community/unbound/install
@@ -0,0 +1,18 @@
+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
+ cat <<EOF
+==> Start with: /etc/rc.d/unbound start
+==> Then, add "nameserver 127.0.0.1" to /etc/resolv.conf.head
+EOF
+}
+
+pre_remove() {
+ /etc/rc.d/unbound stop
+}
+
+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/unbound/rc.d b/community/unbound/rc.d
new file mode 100644
index 000000000..f392450ae
--- /dev/null
+++ b/community/unbound/rc.d
@@ -0,0 +1,33 @@
+#!/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; }
+ ;;
+restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+*)
+ echo "usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
diff --git a/community/unbound/unbound.conf b/community/unbound/unbound.conf
new file mode 100644
index 000000000..445bceff1
--- /dev/null
+++ b/community/unbound/unbound.conf
@@ -0,0 +1,4 @@
+server:
+ username: "unbound"
+ directory: "/etc/unbound"
+ use-syslog: yes