aboutsummaryrefslogtreecommitdiffstats
path: root/main/unbound/APKBUILD
blob: 9446dfd337bf93e70fb545a5bd82c2756dc5be0c (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=unbound
pkgver=1.5.8
pkgrel=1
pkgdesc="Unbound is a validating, recursive, and caching DNS resolver"
pkgusers="unbound"
pkggroups="unbound"
url="http://unbound.net/"
arch="all"
license="BSD"
depends="dnssec-root"
depends_dev="openssl-dev expat-dev ldns-dev libevent-dev"
makedepends="$depends_dev python-dev swig linux-headers"
install="$pkgname.pre-install"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-dbg py-unbound:py $pkgname-migrate"
source="http://unbound.net/downloads/unbound-$pkgver.tar.gz
	conf.patch
	update-unbound-root-hints
	migrate-dnscache-to-unbound
	root.hints
	unbound.initd"

_builddir="$srcdir"/$pkgname-$pkgver
build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-username=unbound \
		--with-run-dir="" \
		--with-pidfile=/var/run/unbound/unbound.pid \
		--with-rootkey-file=/usr/share/dnssec-root/trusted-key.key \
		--with-libevent \
		--with-ldns \
		--with-pthreads \
		--disable-static \
		--disable-rpath \
		--with-ssl \
		--without-pythonmodule \
		--with-pyunbound \
		|| return 1

	# do not link to libpython
	sed -e '/^LIBS=/s/-lpython.*[[:space:]]/ /' \
		-i Makefile || return 1

	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -D contrib/update-anchor.sh \
		"$pkgdir"/usr/share/$pkgname/update-anchor.sh \
		|| return 1
	install -Dm755 "$srcdir"/update-unbound-root-hints \
		"$pkgdir"/etc/periodic/monthly/update-unbound-root-hints \
		|| return 1

	install -m755 -D "$srcdir"/unbound.initd \
		"$pkgdir"/etc/init.d/unbound || return 1
	install -d -o unbound -g unbound "$pkgdir"/var/run/unbound || return 1
	install -m644 "$srcdir"/root.hints "$pkgdir"/etc/unbound/ || return 1

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname/
	for name in CREDITS Changelog FEATURES README TODO; do
		install -m644 "$_builddir"/doc/$name \
			"$pkgdir"/usr/share/doc/$pkgname/$name || return 1
	done
}

libs() {
	pkgdesc="unbound shared libraries"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/lib*.so.* "$subpkgdir"/usr/lib/
}

py() {
	pkgdesc="Python bindings to libunbound"
	mkdir -p "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

migrate() {
	pkgdesc="Simple tool to migrate from dnscache to unbound"
	arch="noarch"
	mkdir -p "$subpkgdir"/usr/bin/
	install -m755 "$srcdir"/migrate-dnscache-to-unbound \
		"$subpkgdir"/usr/bin/
}

md5sums="1c34282bae0c625b86374ee9caaef6f7  unbound-1.5.8.tar.gz
0b8eea5cab939465cfde0ed0ebeed9a9  conf.patch
c1c71cd0e7f9630536a2abf2513c675d  update-unbound-root-hints
5340681e5ec1a1fd47a0de27f5c03c21  migrate-dnscache-to-unbound
a1d7e8e26cf5697de1da80f1d6b52c67  root.hints
b98eded68339fc605ec7e6cbb50e5aa3  unbound.initd"
sha256sums="33567a20f73e288f8daa4ec021fbb30fe1824b346b34f12677ad77899ecd09be  unbound-1.5.8.tar.gz
7399f4efd0ad3866065ef7003d4be891c80a00584f67dc10da9773bed194c63f  conf.patch
0db3ca197b62901fab984cb2559925adbf3307ccd1dca3e1dd69cd1642ff0a36  update-unbound-root-hints
582851b4017044d8642c42c5df09b27494c963e1eebb8be3373b2dbd168d0ac0  migrate-dnscache-to-unbound
f2dd3ea44863ccd6f2b3089c5b98432a2ce6615a0b4c7c4350cbc23666a5d32d  root.hints
d9997000449179dc16f5084bf061453faf09094f843acb1d163757f8000c0cd7  unbound.initd"
sha512sums="0c296a2e5489fae0fdf0ca2ea11ed72f00498c8499f38f308ff32078665d980a2d5a80ee0e106273dc13a146611a238553857c5f301fe9622072382c06b8434a  unbound-1.5.8.tar.gz
90faa8bf352132b63f6b33cd7d7cac164df331272568e7a442d92e021fcf727334f6e28c11ed211bcd3eb62aa606c110e4931b514fecf388d0fbea3810b7530a  conf.patch
0f80b507a8f71b0c00729501d861657ce91a57024cd1963c150d0630c71eccceba370d6e732ff39bb807713672550d87a8c8ecdb9fce6b8b4386c12689603700  update-unbound-root-hints
b26a13c1c88da9611a65705dc59f7233c5e0f6aced0d7d66c18536a969a2de627ca5d4bb55eedd81f2f040fa11bde48eaaeca2850f376e72e7a531678a259131  migrate-dnscache-to-unbound
1c00f53e9d3a3dcbad7c053a5a7d4dedefb12a6b4730b357178b62de7b8cfce42ceed08232a050a3d802c12324a89cd24ced0346b5099a0d8975be4b595105b7  root.hints
540e7a11fa5421e2d103c42d69faf1ba005adcadfac2f65091795a2f00e5b5acd1436b4d2adfe2bb0fdfcbfb44d0967d6bce87620c618549fcd7e32019040f29  unbound.initd"