aboutsummaryrefslogtreecommitdiffstats
path: root/main/unbound/APKBUILD
blob: 96489caeab67f320076497c8a12d4b560ce10dd9 (plain) (blame)
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
116
117
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=unbound
pkgver=1.5.2
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
	swig.patch
	update-unbound-root-hints
	migrate-dnscache-to-unbound
	root.hints
	unbound.initd"

_builddir="$srcdir"/unbound-$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 \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--with-pidfile=/var/run/unbound/unbound.pid \
		--with-username=unbound \
		--with-libevent \
		--with-ldns \
		--with-pthreads \
		--with-rootkey-file=/usr/share/dnssec/root-anchors.txt \
		--disable-static \
		--disable-rpath \
		--with-ssl \
		--without-pythonmodule \
		--with-pyunbound \
		|| return 1
	# do not link to libpython
	sed -i -e '/^LIBS=/s/-lpython.*[[:space:]]/ /' Makefile

	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	rm "$pkgdir"/usr/lib/*.la || return 1
	rm "$pkgdir"/usr/lib/python*/*/*.la || return 1
	install -D contrib/update-anchor.sh \
		"$pkgdir"/usr/share/$pkgname/update-anchor.sh \
		|| 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
	install -Dm755 "$srcdir"/update-unbound-root-hints \
		"$pkgdir"/etc/periodic/monthly/update-unbound-root-hints \
		|| return 1
}

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"
	mkdir -p "$subpkgdir"/usr/bin/
	install -m755 "$srcdir"/migrate-dnscache-to-unbound \
		"$subpkgdir"/usr/bin/
}

md5sums="4aae09f78509eaf002f7869e19f29321  unbound-1.5.2.tar.gz
32fe2914a2723142d3eae9ea556872d3  conf.patch
cca28c13f9b835dfe94ea91012d76e2b  swig.patch
c1c71cd0e7f9630536a2abf2513c675d  update-unbound-root-hints
5340681e5ec1a1fd47a0de27f5c03c21  migrate-dnscache-to-unbound
d7a1cb305b7b5b72df4e574777f76723  root.hints
b98eded68339fc605ec7e6cbb50e5aa3  unbound.initd"
sha256sums="33ab6c6a5ce3247b0a57e34d209fe8936e1218ff89a9b7ca3ff00c2060dd35c7  unbound-1.5.2.tar.gz
48bedb743eda892f82adc8b4ce2e4f5ad216f1ab50d432aef768377edc98165c  conf.patch
e867faf7eaa494d3c3fc93fea36a30fd54914b25455aa843a057292c6fac03b4  swig.patch
0db3ca197b62901fab984cb2559925adbf3307ccd1dca3e1dd69cd1642ff0a36  update-unbound-root-hints
582851b4017044d8642c42c5df09b27494c963e1eebb8be3373b2dbd168d0ac0  migrate-dnscache-to-unbound
eb0ce2b11bf2302a716fa8ef21d55e55f1892dfd853c73c71319bfa5e171eff3  root.hints
d9997000449179dc16f5084bf061453faf09094f843acb1d163757f8000c0cd7  unbound.initd"
sha512sums="d516023b36aae9dd9a3252dd36d4cfbdec99d2e84e9b29b5a2cde9fdce8da37f49b8212b67f4765439f34cda892f407d6f0dfd4efe2c28420c176c2833f54271  unbound-1.5.2.tar.gz
2214882954ed813c564a34cbf433240814f1cc03e62b7aa007d054406d17fa0359514400afe53b9cb0445d25a29ccf9bf27c5974901d30bbfb2bfaf5e755da2b  conf.patch
801bc10922f3a0c7d78a0e61c3ff7b9f719cc152e471908349b98da4ea01f957595c2de918f21e5d7bfffc6c37ecfba3a58f7aca697bc7d01c00232c401ce704  swig.patch
0f80b507a8f71b0c00729501d861657ce91a57024cd1963c150d0630c71eccceba370d6e732ff39bb807713672550d87a8c8ecdb9fce6b8b4386c12689603700  update-unbound-root-hints
b26a13c1c88da9611a65705dc59f7233c5e0f6aced0d7d66c18536a969a2de627ca5d4bb55eedd81f2f040fa11bde48eaaeca2850f376e72e7a531678a259131  migrate-dnscache-to-unbound
058ae1ef089eb4d5ad43ffb83e9f48d586cdfcd4cd4efe9b531a0628d4ee1a69e489187572747a224059a00efd9187012bf59a6da05c4ddfbfa1b7719ff6cbdc  root.hints
540e7a11fa5421e2d103c42d69faf1ba005adcadfac2f65091795a2f00e5b5acd1436b4d2adfe2bb0fdfcbfb44d0967d6bce87620c618549fcd7e32019040f29  unbound.initd"