summaryrefslogtreecommitdiffstats
path: root/main/djbdns/APKBUILD
blob: cfb710055892e6c9173eabf70be077f19eae1c36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=djbdns
pkgver=1.05
pkgrel=32
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
	djbdns-1.05-jumbo-josb.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
7565048ebc981238879122c7f88cc143  dnsroots.patch
6fe7f473233f1c86b76261afd8345bf0  dnstracesort.patch
adb6745606cae593eb5ea6870fc27bd4  djbdns-1.05-jumbo-josb.patch
c7be73fe2fb4ae02d5096fa2c1f55a68  1.05-errno.patch
1292500c04baba3995d9753fe40fdc94  1.05-response.patch
7695bf50559c09798ec852b578ac8698  tinydns.pre-install
3f4cd61c41f760c3007a8b09a4da091f  tinydns.initd
7dcf6674c07d46c736b3c25d9c92384a  tinydns.confd
e09c3a6ba6917e16f4736ab5c070dbe9  dnscache.pre-install
ec15af30819b9e146f86223753b367a0  dnscache.initd
e2938593277d7a87806e70e145a90c3f  dnscache.confd"