From 415856bdd4f48ab4f2732996f0bae58595092bbe Mon Sep 17 00:00:00 2001 From: Parabola Date: Tue, 5 Apr 2011 14:26:38 +0000 Subject: Tue Apr 5 14:26:38 UTC 2011 --- community/unbound/PKGBUILD | 46 ++++++++++++++++++++++++++++++++++++++++++ community/unbound/install | 18 +++++++++++++++++ community/unbound/rc.d | 33 ++++++++++++++++++++++++++++++ community/unbound/unbound.conf | 4 ++++ 4 files changed, 101 insertions(+) create mode 100644 community/unbound/PKGBUILD create mode 100644 community/unbound/install create mode 100644 community/unbound/rc.d create mode 100644 community/unbound/unbound.conf (limited to 'community/unbound') 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 +# Contributor: Hisato Tatekura +# Contributor: Massimiliano Torromeo + +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 < 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 -- cgit v1.2.3-54-g00ecf