aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/pdnsd/APKBUILD101
-rw-r--r--main/pdnsd/pdnsd.conf51
-rw-r--r--main/pdnsd/pdnsd.confd18
-rw-r--r--main/pdnsd/pdnsd.initd25
-rw-r--r--main/pdnsd/pdnsd.post-deinstall4
-rw-r--r--main/pdnsd/pdnsd.pre-install4
6 files changed, 203 insertions, 0 deletions
diff --git a/main/pdnsd/APKBUILD b/main/pdnsd/APKBUILD
new file mode 100644
index 0000000000..cdc494cb44
--- /dev/null
+++ b/main/pdnsd/APKBUILD
@@ -0,0 +1,101 @@
+# Contributor: Matt Smith <mcs@darkregion.net>
+# Maintainer: Matt Smith <mcs@darkregion.net>
+pkgname=pdnsd
+pkgver=1.2.8
+_realver=$pkgver-par
+pkgrel=0
+pkgdesc="A proxy DNS server with permanent caching"
+url="http://www.phys.uu.nl/~rombouts/pdnsd/"
+arch="all"
+license="GPL"
+depends=
+depends_dev=
+makedepends="$depends_dev"
+install="$pkgname.pre-install $pkgname.post-deinstall"
+subpackages="$pkgname-doc"
+pkgusers="pdnsd"
+pkggroups="pdnsd"
+source="http://www.phys.uu.nl/~rombouts/pdnsd/releases/$pkgname-$_realver.tar.gz
+ pdnsd.initd
+ pdnsd.confd
+ pdnsd.conf
+ "
+
+_builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --enable-ipv6 \
+ --with-random-device=/dev/urandom \
+ --enable-tcp-subseq \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname || return 1
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname || return 1
+ install -m644 -D "$srcdir"/$pkgname.conf \
+ "$pkgdir"/etc/$pkgname.conf || return 1
+
+ chown -R pdnsd "$pkgdir"/var/cache/pdnsd || return 1
+ sed -ri 's/([ ]*run_as=)"nobody";/\1"pdnsd";/' \
+ "$pkgdir"/etc/pdnsd.conf.sample || return 1
+ sed -ri '/pid_file/d' "$pkgdir"/etc/pdnsd.conf.sample || return 1
+ sed -ri '/query_method/d' "$pkgdir"/etc/pdnsd.conf.sample || return 1
+}
+
+doc() {
+ arch="noarch"
+
+ mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/html || return 1
+ mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/txt || return 1
+ mkdir -p "$subpkgdir"/usr/share/$pkgname/contrib || return 1
+
+ # /usr/share/{man,doc/$pkgname}
+ cp -a "$pkgdir"/usr/share/ "$subpkgdir"/usr/ || return 1
+ rm -rf "$pkgdir"/usr/share/ || return 1
+ _docs="AUTHORS COPYING COPYING.BSD ChangeLog ChangeLog.old \
+ NEWS README README.par README.par.old THANKS TODO"
+ for _doc in $_docs; do
+ cp "$_builddir"/$_doc "$subpkgdir"/usr/share/doc/$pkgname/ \
+ || return 1
+ done
+ cp -R "$_builddir"/doc/html/* \
+ "$subpkgdir"/usr/share/doc/$pkgname/html/ || return 1
+ cp -R "$_builddir"/doc/txt/* \
+ "$subpkgdir"/usr/share/doc/$pkgname/txt/ || return 1
+
+ # /usr/share/$pkgname
+ mv "$pkgdir"/etc/pdnsd.conf.sample \
+ "$subpkgdir"/usr/share/$pkgname/ || return 1
+ _contribs="README change_pdnsd_server_ip.pl dhcp2pdnsd pdnsd_dhcp.pl"
+ for _contrib in $_contribs; do
+ cp -a "$_builddir"/contrib/$_contrib \
+ "$subpkgdir"/usr/share/$pkgname/contrib/ || return 1
+ done
+}
+
+md5sums="779c5d19576e561fbf2455de435e5597 pdnsd-1.2.8-par.tar.gz
+14d6c0a1e9e552999cc4efb2c1251d98 pdnsd.initd
+4bced9066febfe33b4a527f28cfb6a48 pdnsd.confd
+f7cf4b9391b67ee421485a0c24aa8a5c pdnsd.conf"
diff --git a/main/pdnsd/pdnsd.conf b/main/pdnsd/pdnsd.conf
new file mode 100644
index 0000000000..f3e6ae4b75
--- /dev/null
+++ b/main/pdnsd/pdnsd.conf
@@ -0,0 +1,51 @@
+#
+# Default Alpine Linux pdnsd config
+#
+# See /usr/share/pdnsd/pdnsd.conf.sample and the pdnsd.conf(5) manpage,
+# both available in the pdnsd-doc package.
+#
+# Comments can begin with either '#' or '//', and entire blocks may be
+# commented out with '/*' and '*/'.
+#
+global {
+ perm_cache=2048;
+ cache_dir="/var/cache/pdnsd";
+ run_as="pdnsd";
+ server_ip = any;
+ status_ctl = on;
+# paranoid=on; # This option reduces the chance of cache poisoning
+ # but may make pdnsd less efficient, unfortunately.
+ min_ttl=15m; # Retain cached entries at least 15 minutes.
+ max_ttl=1w; # One week.
+ timeout=10; # Global timeout option (10 seconds).
+ neg_domain_pol=on;
+}
+
+server {
+ label= "googledns";
+ ip = 8.8.8.8, 8.8.4.4;
+ proxy_only=on;
+ lean_query=on;
+ timeout=4; # Server timeout; this may be much shorter
+ # that the global timeout option.
+ uptest=none;
+ interval=10m; # Check every 10 minutes.
+ purge_cache=off;
+}
+
+/*
+source {
+ owner=localhost;
+# serve_aliases=on;
+ file="/etc/hosts";
+}
+*/
+
+rr {
+ name=localhost;
+ reverse=on;
+ a=127.0.0.1;
+# a=::1;
+ owner=localhost;
+ soa=localhost,root.localhost,42,86400,900,86400,86400;
+}
diff --git a/main/pdnsd/pdnsd.confd b/main/pdnsd/pdnsd.confd
new file mode 100644
index 0000000000..8f8820c8da
--- /dev/null
+++ b/main/pdnsd/pdnsd.confd
@@ -0,0 +1,18 @@
+#
+# Specify pdnsd options here.
+#
+# -4 run in IPv4 mode
+# -6 run in IPv6 mode
+# -a autodetects IPv6 supports, falls back to IPv4
+# NOTE: IPv6 mode seems to have issues.
+# -d run in daemon mode
+# -s enables the status control socket so pdnsd-ctl can be used at run-time
+# (same as setting status_ctl=on; in the config file)
+# -t enables the TCP server thread alongside the UDP server thread
+# -mut sets the query method to 'ut': udp first, fallback to tcp
+# -c specifies the config file
+# -p specifies the pid file
+# -g enables debugging/logging output at /var/cache/pdnsd/pdnsd.debug
+# -vn where n specifies the debugging verbosity level (0-3)
+
+pdnsd_opts="-4 -d -s -t -mut -c /etc/pdnsd.conf -p /var/run/pdnsd.pid"
diff --git a/main/pdnsd/pdnsd.initd b/main/pdnsd/pdnsd.initd
new file mode 100644
index 0000000000..355163ce12
--- /dev/null
+++ b/main/pdnsd/pdnsd.initd
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+
+name=pdnsd
+daemon=/usr/sbin/$name
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ ebegin "Starting ${name}"
+ start-stop-daemon --start --quiet \
+ --pidfile /var/run/${name}.pid \
+ --exec ${daemon} -- ${pdnsd_opts}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${name}"
+ start-stop-daemon --stop --quiet \
+ --pidfile /var/run/$name.pid \
+ --exec ${daemon}
+ eend $?
+}
diff --git a/main/pdnsd/pdnsd.post-deinstall b/main/pdnsd/pdnsd.post-deinstall
new file mode 100644
index 0000000000..f5cb9e80cb
--- /dev/null
+++ b/main/pdnsd/pdnsd.post-deinstall
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+deluser pdnsd 2>/dev/null
+exit 0
diff --git a/main/pdnsd/pdnsd.pre-install b/main/pdnsd/pdnsd.pre-install
new file mode 100644
index 0000000000..1ae14a9a5e
--- /dev/null
+++ b/main/pdnsd/pdnsd.pre-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+adduser -S -H -h /var/cache/pdnsd -s /bin/false pdnsd 2>/dev/null
+exit 0