aboutsummaryrefslogtreecommitdiffstats
path: root/community/knot-resolver/APKBUILD
blob: 03345ae780dcc94cc8f917173362205d53fdccd3 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: tcely <knot-resolver+aports@tcely.33mail.com>
pkgname=knot-resolver
pkgver=3.2.1
pkgrel=3
pkgdesc="Minimalistic caching DNS resolver implementation"
url="https://www.knot-resolver.cz/"
# luajit is not available for disabled arches
arch="all !s390x"
license="GPL-3.0"
pkgusers="kresd"
pkggroups="kresd"
depends="dns-root-hints lua5.1-sec lua5.1-socket"
depends_dnstap=""
depends_dnstap_dev="fstrm-dev protobuf-c-dev"
depends_http="$pkgname lua5.1-http"
depends_dev="knot-dev>=2.8.0 libedit-dev libuv-dev lmdb-dev luajit-dev $depends_dnstap_dev"
makedepends="$depends_dev bash dnssec-root vim"
checkdepends="cmocka-dev"
install="$pkgname.pre-install"
subpackages="$pkgname-mod-http:http:noarch $pkgname-mod-dnstap:dnstap $pkgname-dev $pkgname-doc $pkgname-openrc"
source="https://secure.nic.cz/files/$pkgname/$pkgname-$pkgver.tar.xz
	$pkgname.initd
	$pkgname.confd
	$pkgname.logrotate
	knot-2.8.0-compat.patch
	config"

# secfixes:
#   2.3.0-r0:
#     - CVE-2018-1110

_flags="PREFIX=/usr
	ETCDIR=/etc/$pkgname"

prepare() {
	default_prepare

	# Make sure embedded LMDB library is not used.
	rm -rf contrib/lmdb
}

build() {
	make $_flags
}

check() {
	make $_flags -j1 check
}

package() {
	make $_flags DESTDIR="$pkgdir" install

	cd "$pkgdir"

	# Move sample configs to -doc.
	mkdir -p ./usr/share/doc/$pkgname
	mv ./etc/$pkgname/config* ./usr/share/doc/$pkgname/
	chmod 644 ./usr/share/doc/$pkgname/*

	rm -f ./etc/$pkgname/root.hints
	ln -s ../../usr/share/dns-root-hints/named.root ./etc/$pkgname/root.hints

	install -m 640 -o root -g kresd "$srcdir"/config \
		./etc/$pkgname/config

	install -m 755 -o kresd -g kresd -d ./var/lib/$pkgname
	install -m 644 -o kresd -D /usr/share/dnssec-root/trusted-key.key \
		./var/lib/$pkgname/root.keys

	install -m 755 -D "$srcdir"/$pkgname.initd ./etc/init.d/$pkgname
	install -m 644 -D "$srcdir"/$pkgname.confd ./etc/conf.d/$pkgname

	install -m 644 -D "$srcdir"/$pkgname.logrotate ./etc/logrotate.d/$pkgname
}

http() {
	pkgdesc="Knot Resolver - HTTP/2 services"
	depends="$depends_http"
	local moddir="usr/lib/kdns_modules"

	mkdir -p "$subpkgdir"/$moddir
	mv "$pkgdir"/$moddir/http* "$subpkgdir"/$moddir/
}

dnstap() {
	pkgdesc="Knot Resolver - dnstap logging"
	depends="$depends_dnstap"
	local moddir="usr/lib/kdns_modules"

	mkdir -p "$subpkgdir"/$moddir
	mv "$pkgdir"/$moddir/dnstap.so "$subpkgdir"/$moddir/
}

sha512sums="2ed79176183a685bf6365081706e68e4add05965a5f53a6f38ae4a5c204d29952eaf511ffbf18c646a0a843a032b425eb0592de27dafbf977d976946a3437351  knot-resolver-3.2.1.tar.xz
0e9b947ed0fe39a600ba8fe3cdeacf07521cdd6c371007dd15524f67c75ea024994a8c11820d70c57ef180c90f492eae69ef167152ad84c24a47c885710a7974  knot-resolver.initd
9d0d629405df243dc0f782abd6fcaaaf13fbce78d881f7ce213cfd2a55cfbfd87af2ba976061bf7b5d3d055edec98b42632395390f2a469648c27f96124997a6  knot-resolver.confd
688aeacb0c1f21c7e532533b402e67068897217713fb668636df7533000b493981ddfa0497f8dba7da7c804ee4ab8d587a4f52155b4e2bf1f4025d2588d314bb  knot-resolver.logrotate
ea10749307aa23341daf7bb77652300b8c78537fc2fa7c084d3e1e618b0ee11873c056b328bd760673d8fdf45c2f3106861fcf0ac4e8090643516419062fcf0f  knot-2.8.0-compat.patch
913a557dde84e9dac7c7300ab093285865fa57f3875fc357e680f04a0e85af6610a0e33da6262431cbb06a2c5a115952e742e48c8568d4eb82182906170b4a73  config"