diff options
Diffstat (limited to 'main/djbdns')
-rw-r--r-- | main/djbdns/1.05-errno.patch | 11 | ||||
-rw-r--r-- | main/djbdns/1.05-response.patch | 11 | ||||
-rw-r--r-- | main/djbdns/APKBUILD | 86 | ||||
-rw-r--r-- | main/djbdns/dnscache.confd | 23 | ||||
-rwxr-xr-x | main/djbdns/dnscache.initd | 59 | ||||
-rw-r--r-- | main/djbdns/dnscache.pre-install | 5 | ||||
-rw-r--r-- | main/djbdns/dnsroots.patch | 18 | ||||
-rw-r--r-- | main/djbdns/dnstracesort.patch | 11 | ||||
-rw-r--r-- | main/djbdns/headtail.patch | 67 | ||||
-rw-r--r-- | main/djbdns/tinydns.confd | 2 | ||||
-rwxr-xr-x | main/djbdns/tinydns.initd | 87 | ||||
-rw-r--r-- | main/djbdns/tinydns.pre-install | 5 |
12 files changed, 385 insertions, 0 deletions
diff --git a/main/djbdns/1.05-errno.patch b/main/djbdns/1.05-errno.patch new file mode 100644 index 000000000..58f2f4b6c --- /dev/null +++ b/main/djbdns/1.05-errno.patch @@ -0,0 +1,11 @@ +--- a/error.h 2001-02-11 15:11:45.000000000 -0600 ++++ b/error.h 2003-02-26 02:10:21.000000000 -0600 +@@ -1,7 +1,7 @@ + #ifndef ERROR_H + #define ERROR_H + +-extern int errno; ++#include <errno.h> + + extern int error_intr; + extern int error_nomem; diff --git a/main/djbdns/1.05-response.patch b/main/djbdns/1.05-response.patch new file mode 100644 index 000000000..eb6ae5904 --- /dev/null +++ b/main/djbdns/1.05-response.patch @@ -0,0 +1,11 @@ +--- a/response.c.orig 2009-02-24 21:04:06.000000000 -0800 ++++ b/response.c 2009-02-24 21:04:25.000000000 -0800 +@@ -34,7 +34,7 @@ + uint16_pack_big(buf,49152 + name_ptr[i]); + return response_addbytes(buf,2); + } +- if (dlen <= 128) ++ if ((dlen <= 128) && (response_len < 16384)) + if (name_num < NAMES) { + byte_copy(name[name_num],dlen,d); + name_ptr[name_num] = response_len; diff --git a/main/djbdns/APKBUILD b/main/djbdns/APKBUILD new file mode 100644 index 000000000..0596907a7 --- /dev/null +++ b/main/djbdns/APKBUILD @@ -0,0 +1,86 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=djbdns +pkgver=1.05 +pkgrel=26 +pkgdesc="Excellent high-performance DNS services" +url="http://cr.yp.to/djbdns.html" +license="public-domain" +depends= +subpackages="tinydns dnscache" +source="http://cr.yp.to/djbdns/$pkgname-$pkgver.tar.gz + headtail.patch + dnsroots.patch + dnstracesort.patch + $pkgver-errno.patch + $pkgver-response.patch + tinydns.pre-install + tinydns.initd + tinydns.confd + dnscache.pre-install + dnscache.initd + dnscache.confd + " + +build() { + cd "$srcdir"/$pkgname-$pkgver + for i in ../*.patch; do + msg "Applying $i..." + patch -p1 < $i || return 1 + done + + echo "${CC:-"gcc"} ${CFLAGS}" > conf-cc + echo "${CC:-"gcc"} ${LDFLAGS}" > conf-ld + echo "/usr" > conf-home + make -j1 || return 1 + + mkdir -p "$pkgdir"/etc/ + cp dnsroots.global "$pkgdir"/etc/ + mkdir -p "$pkgdir"/usr/bin + cp *-conf dnscache tinydns walldns rbldns pickdns axfrdns \ + *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx \ + dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort \ + "$pkgdir"/usr/bin/ + mkdir -p "$pkgdir"/usr/share/doc/djbdns +} + +tinydns() { + pkgdesc="A small and secure DNS server" + install=tinydns.pre-install + mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/etc/tinydns \ + "$subpkgdir"/var/cache/tinydns + mv "$pkgdir"/usr/bin/tinydns* "$subpkgdir"/usr/bin + install -D -m755 "$srcdir"/tinydns.initd \ + "$subpkgdir"/etc/init.d/tinydns + install -D -m644 "$srcdir"/tinydns.confd \ + "$subpkgdir"/etc/conf.d/tinydns +} + +dnscache() { + pkgdesc="A recursive resolver" + install=dnscache.pre-install + mkdir -p "$subpkgdir"/usr/bin \ + "$subpkgdir"/etc/dnscache/ip \ + "$subpkgdir"/etc/dnscache/servers + + cp "$pkgdir"/etc/dnsroots.global "$subpkgdir"/etc/dnscache/servers/@ + touch "$subpkgdir"/etc/dnscache/ip/127 || return 1 + + mv "$pkgdir"/usr/bin/dnscache* "$subpkgdir"/usr/bin + install -D -m755 "$srcdir"/dnscache.initd \ + "$subpkgdir"/etc/init.d/dnscache + install -D -m644 "$srcdir"/dnscache.confd \ + "$subpkgdir"/etc/conf.d/dnscache +} + +md5sums="3147c5cd56832aa3b41955c7a51cbeb2 djbdns-1.05.tar.gz +0d2adaf9f1626043e8702b825cdccdd6 headtail.patch +dfd675b2775efcbb604413a84db8bf1a dnsroots.patch +6fe7f473233f1c86b76261afd8345bf0 dnstracesort.patch +c7be73fe2fb4ae02d5096fa2c1f55a68 1.05-errno.patch +1292500c04baba3995d9753fe40fdc94 1.05-response.patch +7695bf50559c09798ec852b578ac8698 tinydns.pre-install +e8a84fc4ee5ff1525b4f74889422e93c tinydns.initd +7dcf6674c07d46c736b3c25d9c92384a tinydns.confd +e09c3a6ba6917e16f4736ab5c070dbe9 dnscache.pre-install +e368a86ddc320937d663dd47684ba410 dnscache.initd +e2938593277d7a87806e70e145a90c3f dnscache.confd" diff --git a/main/djbdns/dnscache.confd b/main/djbdns/dnscache.confd new file mode 100644 index 000000000..f456bf8db --- /dev/null +++ b/main/djbdns/dnscache.confd @@ -0,0 +1,23 @@ +# DNSCACHE configuration variables: + +# IPSEND - ip address to use for requests use 0.0.0.0 for default route +IPSEND=0.0.0.0 + +# CACHESIZE - Num bytes to use for the cache +CACHESIZE=1000000 + +# IP - IP addr to listen on +IP=127.0.0.1 + +#------------------------------------------------------------------------ +# The following are flags. Setting them to ANY value +# (even "false" or "off") will turn the feature on. +#------------------------------------------------------------------------ + +# HIDETTL - always return TTL as 0 +#HIDETTL= + +# FORWARDONLY - servers/@ are parent caches, not root servers +#FORWARDONLY= + + diff --git a/main/djbdns/dnscache.initd b/main/djbdns/dnscache.initd new file mode 100755 index 000000000..481022496 --- /dev/null +++ b/main/djbdns/dnscache.initd @@ -0,0 +1,59 @@ +#!/sbin/runscript +# control n instances of dnscache, without daemontools +# written for alpine linux - NBA April 2007 + +# -- Statrup variables +UID=$( grep dnscache /etc/passwd | cut -f3 -d: ) +GID=$( grep dnscache /etc/group | cut -f3 -d: ) +ROOT=/etc/dnscache +DAEMON=/usr/bin/dnscache +VARRUN=/var/run/dnscache + + +#----------------------------------------------------------------- +# Main program + +start() { + + ebegin "Starting dnscache" + if [ -z "$UID" ] || [ -z "$GID" ]; then + eend 1 "dnscache user or group missing" + return 1 + fi + + # if its already running, just report it is + if [ -e ${VARRUN}.pid ] && [ -d /proc/$( cat ${VARRUN}.pid ) ]; then + eend 0 + return 0 + fi + + ( + export UID GID ROOT + [ -n "$IPSEND" ] && export IPSEND + [ -n "$IP" ] && export IP + [ -n "$HIDETTL" ] && export HIDETTL + [ -n "$IPSEND" ] && export IPSEND + [ -n "$CACHESIZE" ] && export CACHESIZE + [ -n "$FORWARDONLY" ] && export FORWARDONLY + + $DAEMON </dev/urandom >/dev/null 2>/dev/null & + pid=$! + sleep 1 + # Check if its still running + if ! [ -d /proc/$pid ]; then + $DAEMON </dev/urandom + return 1 + fi + echo $pid > ${VARRUN}.pid + eend $? + return 0 + ) +} + +stop() { + ebegin "Stopping dnscache" + start-stop-daemon --stop -m --pidfile ${VARRUN}.pid --oknodo \ + --exec $DAEMON && rm ${VARRUN}.pid + eend $? +} + diff --git a/main/djbdns/dnscache.pre-install b/main/djbdns/dnscache.pre-install new file mode 100644 index 000000000..061b8f028 --- /dev/null +++ b/main/djbdns/dnscache.pre-install @@ -0,0 +1,5 @@ +#!/bin/sh + +adduser -h /etc/dnscache -g dnscache -s /bin/false -H -D dnscache 2>/dev/null +exit 0 + diff --git a/main/djbdns/dnsroots.patch b/main/djbdns/dnsroots.patch new file mode 100644 index 000000000..5db44ec8f --- /dev/null +++ b/main/djbdns/dnsroots.patch @@ -0,0 +1,18 @@ +--- djbdns-1.05.old/dnsroots.global.old Fri May 31 19:42:37 2002 ++++ djbdns-1.05/dnsroots.global Thu Jan 29 21:41:56 2004 +@@ -1,5 +1,5 @@ + 198.41.0.4 +-128.9.0.107 ++192.228.79.201 + 192.33.4.12 + 128.8.10.90 + 192.203.230.10 +@@ -7,7 +7,7 @@ + 192.112.36.4 + 128.63.2.53 + 192.36.148.17 +-198.41.0.10 ++192.58.128.30 + 193.0.14.129 + 198.32.64.12 + 202.12.27.33 diff --git a/main/djbdns/dnstracesort.patch b/main/djbdns/dnstracesort.patch new file mode 100644 index 000000000..3bf56f5a1 --- /dev/null +++ b/main/djbdns/dnstracesort.patch @@ -0,0 +1,11 @@ +--- djbdns-1.05/dnstracesort.sh.orig 2006-04-26 21:52:54.000000000 +0200 ++++ djbdns-1.05/dnstracesort.sh 2006-04-26 21:53:02.000000000 +0200 +@@ -12,7 +12,7 @@ + } + print + } +-' | sort -t: +0 -2 +4 +3 -4 +2 -3 | uniq | awk -F: ' ++' | sort -t: -k 1,3 -k 5 -k 4,5 -k 3,4 | uniq | awk -F: ' + { + type = $1 + q = $2 diff --git a/main/djbdns/headtail.patch b/main/djbdns/headtail.patch new file mode 100644 index 000000000..31854803b --- /dev/null +++ b/main/djbdns/headtail.patch @@ -0,0 +1,67 @@ +diff -Naur /tmp/djbdns-1.05/Makefile djbdns-1.05/Makefile +--- a/Makefile 2003-11-16 20:33:41.000000000 +0100 ++++ b/Makefile 2003-11-16 20:35:15.000000000 +0100 +@@ -31,7 +31,7 @@ + + auto_home.c: \ + auto-str conf-home +- ./auto-str auto_home `head -1 conf-home` > auto_home.c ++ ./auto-str auto_home `head -n 1 conf-home` > auto_home.c + + auto_home.o: \ + compile auto_home.c +@@ -205,14 +205,14 @@ + choose: \ + warn-auto.sh choose.sh conf-home + cat warn-auto.sh choose.sh \ +- | sed s}HOME}"`head -1 conf-home`"}g \ ++ | sed s}HOME}"`head -n 1 conf-home`"}g \ + > choose + chmod 755 choose + + compile: \ + warn-auto.sh conf-cc + ( cat warn-auto.sh; \ +- echo exec "`head -1 conf-cc`" '-c $${1+"$$@"}' \ ++ echo exec "`head -n 1 conf-cc`" '-c $${1+"$$@"}' \ + ) > compile + chmod 755 compile + +@@ -449,7 +449,7 @@ + dnstracesort: \ + warn-auto.sh dnstracesort.sh conf-home + cat warn-auto.sh dnstracesort.sh \ +- | sed s}HOME}"`head -1 conf-home`"}g \ ++ | sed s}HOME}"`head -n 1 conf-home`"}g \ + > dnstracesort + chmod 755 dnstracesort + +@@ -570,7 +570,7 @@ + warn-auto.sh conf-ld + ( cat warn-auto.sh; \ + echo 'main="$$1"; shift'; \ +- echo exec "`head -1 conf-ld`" \ ++ echo exec "`head -n 1 conf-ld`" \ + '-o "$$main" "$$main".o $${1+"$$@"}' \ + ) > load + chmod 755 load +@@ -758,7 +758,7 @@ + rts: \ + warn-auto.sh rts.sh conf-home + cat warn-auto.sh rts.sh \ +- | sed s}HOME}"`head -1 conf-home`"}g \ ++ | sed s}HOME}"`head -n 1 conf-home`"}g \ + > rts + chmod 755 rts + +@@ -901,8 +901,8 @@ + systype: \ + find-systype.sh conf-cc conf-ld trycpp.c x86cpuid.c + ( cat warn-auto.sh; \ +- echo CC=\'`head -1 conf-cc`\'; \ +- echo LD=\'`head -1 conf-ld`\'; \ ++ echo CC=\'`head -n 1 conf-cc`\'; \ ++ echo LD=\'`head -n 1 conf-ld`\'; \ + cat find-systype.sh; \ + ) | sh > systype + diff --git a/main/djbdns/tinydns.confd b/main/djbdns/tinydns.confd new file mode 100644 index 000000000..840570a63 --- /dev/null +++ b/main/djbdns/tinydns.confd @@ -0,0 +1,2 @@ +# IP is the ip address to listen on +IP=127.0.0.1 diff --git a/main/djbdns/tinydns.initd b/main/djbdns/tinydns.initd new file mode 100755 index 000000000..a68474c4e --- /dev/null +++ b/main/djbdns/tinydns.initd @@ -0,0 +1,87 @@ +#!/sbin/runscript +# control an instance of tinydns, without daemontools +# written for alpine linux - NBA April 2007 + +opts="reload" + +# -- Statrup variables +DAEMON=/usr/bin/tinydns +COMPILER=/usr/bin/tinydns-data + +IFACE="${SVCNAME#*.}" +if [ -n "$IFACE" ] && [ "${SVCNAME}" != "tinydns" ]; then + ROOT=${ROOT:-/var/cache/tinydns.$IFACE} + VARRUN=${VARRUN:-/var/run/tinydns.$IFACE} + DATADIR=${DATADIR:-/etc/tinydns.$IFACE} +else + ROOT=${ROOT:-/var/cache/tinydns} + VARRUN=${VARRUN:-/var/run/tinydns} + DATADIR=${DATADIR:-/etc/tinydns} +fi + + +#----------------------------------------------------------------- +# Main program +reload() { + local rc opwd="$opwd" + UID=$( grep tinydns /etc/passwd | cut -f3 -d: ) + GID=$( grep tinydns /etc/group | cut -f3 -d: ) + + # Create the $ROOT directory if necessary + if [ ! -d "$ROOT" ]; then + mkdir -p "$ROOT" + chown $UID:$GID "$ROOT" + fi + + # If a file named "data" exists in the $ROOT dir + # Then we just use it and ignore anything else + # If the "data" file does not exist, we attempt + # to build one out of the "zone files". + ebegin "Generating tinydns cache" + rm -f "$ROOT/data" + if [ -e $DATADIR/data ]; then + ln -sf "$DATADIR/data" "$ROOT/data" + else + set -- $( find $DATADIR -type f ) + if [ $# -eq 0 ]; then + eend 1 "Missing data or zone files in $DATADIR" + return 1 + fi + cat "$@" > "$ROOT/data" + fi + cd "$ROOT" || return 1 + [ -e data ] || rm -f data.cdb + $COMPILER + rc=$? + cd "$opwd" + eend $rc + return $rc +} + +start() { + # Always do a reload on start + reload || return 1 + + ebegin "Starting tinydns" + if [ -z "$UID" ] || [ -z "$GID" ]; then + eend 1 "tinydns user or group missing" + return 1 + fi + + if [ -z "$IP" ]; then + eend 1 "IP is not specified in /etc/conf.d/$SVCNAME" + return 1 + fi + + start-stop-daemon --start --env "UID=$UID" --env "GID=$GID" \ + --env "ROOT=$ROOT" --env "IP=$IP" --pidfile ${VARRUN}.pid \ + --background --make-pidfile --exec $DAEMON + eend $? +} + +stop() { + ebegin "Stopping tinydns" + start-stop-daemon --stop --pidfile ${VARRUN}.pid --exec $DAEMON + eend $? +} + diff --git a/main/djbdns/tinydns.pre-install b/main/djbdns/tinydns.pre-install new file mode 100644 index 000000000..11ea87abc --- /dev/null +++ b/main/djbdns/tinydns.pre-install @@ -0,0 +1,5 @@ +#!/bin/sh + +adduser -h /etc/tinydns -g tinydns -s /bin/false -H -D tinydns 2>/dev/null +exit 0 + |