summaryrefslogtreecommitdiff
path: root/community/pdns-recursor
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-11-01 01:47:44 -0700
committerroot <root@rshg054.dnsready.net>2012-11-01 01:47:44 -0700
commit83a318800db22408628e60c9e1730578efcfee37 (patch)
tree9f1c330c5019dd940e41c44a7c1db13d337058a6 /community/pdns-recursor
parent5827948456201df72a1bd73e87977c569129fb27 (diff)
Thu Nov 1 01:47:04 PDT 2012
Diffstat (limited to 'community/pdns-recursor')
-rw-r--r--community/pdns-recursor/PKGBUILD31
-rw-r--r--community/pdns-recursor/pdns-recursor.rc35
2 files changed, 66 insertions, 0 deletions
diff --git a/community/pdns-recursor/PKGBUILD b/community/pdns-recursor/PKGBUILD
new file mode 100644
index 000000000..14b67ce63
--- /dev/null
+++ b/community/pdns-recursor/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 79210 2012-10-31 22:50:00Z tomegun $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=pdns-recursor
+pkgver=3.3
+pkgrel=2
+pkgdesc="PowerDNS recursor"
+url="http://www.powerdns.com"
+license=('GPL')
+arch=('i686' 'x86_64')
+depends=('gcc-libs' 'lua')
+makedepends=('boost')
+backup=('etc/powerdns/recursor.conf')
+source=("http://downloads.powerdns.com/releases/${pkgname}-${pkgver}.tar.bz2"
+ 'pdns-recursor.rc')
+md5sums=('87daeeebb6f7af9e07814ff6c43300dd'
+ '5b3aa3c8ed2edf55821af16cfb7ef252')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ LUA=1 LUA_CPPFLAGS_CONFIG= LUA_LIBS_CONFIG=-llua make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ install -d -m755 "${pkgdir}/etc/rc.d"
+ mv "${pkgdir}/etc/powerdns/recursor.conf-dist" "${pkgdir}/etc/powerdns/recursor.conf"
+ install -m755 "${srcdir}/pdns-recursor.rc" "${pkgdir}/etc/rc.d/pdns-recursor"
+ rm -rf "${pkgdir}/etc/init.d"
+}
diff --git a/community/pdns-recursor/pdns-recursor.rc b/community/pdns-recursor/pdns-recursor.rc
new file mode 100644
index 000000000..992f0b086
--- /dev/null
+++ b/community/pdns-recursor/pdns-recursor.rc
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting PowerDNS recursor"
+ ! /usr/sbin/rec_control ping > /dev/null 2>&1 && /usr/sbin/pdns_recursor --daemon
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon pdns-recursor
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping PowerDNS recursor"
+ rec_control quit > /dev/null 2>&1
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon pdns-recursor
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0