aboutsummaryrefslogtreecommitdiffstats
path: root/community/knot-resolver/APKBUILD
blob: a45a40a1499f5a7c8ef03e3879886904f6a59b7a (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: tcely <knot-resolver+aports@tcely.33mail.com>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=knot-resolver
pkgver=4.2.2
pkgrel=2
pkgdesc="Minimalistic caching DNS resolver implementation"
url="https://www.knot-resolver.cz/"
arch="all !s390x"  # limited by luajit
license="GPL-3.0"
pkgusers="kresd"
pkggroups="kresd"
depends="dns-root-hints dnssec-root lua5.1-sec lua5.1-socket"
_depends_dnstap_dev="fstrm-dev protobuf-dev protobuf-c-dev"
_depends_http="$pkgname lua5.1-http"
depends_dev="knot-dev>=2.8.0 libedit-dev libuv-dev>=1.7 lmdb-dev luajit-dev>=2.0 $_depends_dnstap_dev"
depends_static="$pkgname-dev"
makedepends="$depends_dev bash cmake gnutls-dev luacheck meson>=0.46 ninja pkgconf py3-flake8"
checkdepends="cmocka-dev"
install="$pkgname.pre-install"
subpackages="
	$pkgname-mod-http:http:noarch
	$pkgname-mod-dnstap:dnstap
	$pkgname-libs-static
	$pkgname-dev
	$pkgname-doc
	$pkgname-openrc
	"
source="https://secure.nic.cz/files/$pkgname/$pkgname-$pkgver.tar.xz
	$pkgname.logrotate
	$pkgname.confd
	$pkgname.initd
	"
builddir="$srcdir/$pkgname-$pkgver"

# secfixes:
#   4.1.0-r0:
#     - CVE-2019-10190
#     - CVE-2019-10191
#   2.3.0-r0:
#     - CVE-2018-1110

build() {
	meson build \
		--prefix=/usr \
		--buildtype=release \
		--default-library=both \
		-Dclient=enabled \
		-Dgroup="$pkggroups" \
		-Dinstall_kresd_conf=enabled \
		-Dunit_tests=enabled \
		-Duser="$pkgusers" \
		-Droot_hints=/usr/share/dns-root-hints/named.root \
		-Dmanaged_ta=disabled \
		-Dkeyfile_default=/usr/share/dnssec-root/trusted-key.key

	ninja -C build
}

check() {
	meson test -C build
}

package() {
	DESTDIR="$pkgdir" ninja install -C build

	cd "$pkgdir"

	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/$pkgname/kres_modules"

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

dnstap() {
	pkgdesc="Knot Resolver - dnstap logging"
	depends="$_depends_dnstap"

	local moddir="usr/lib/$pkgname/kres_modules"

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

gpg_signature_extensions="asc"
gpgfingerprints="
	good:BE26 EBB9 CBE0 59B3 910C  A35B CE8D D6A1 A50A 21E4
	good:4A8B A48C 2AED 933B D495  C509 A1FB A5F7 EF8C 4869
	B600 6460 B60A 80E7 8206  2449 E747 DF1F 9575 A3AA
	"

sha512sums="53a7cb9419f090609c3ca31f606d40c6b023a1356de79899bc867b0511cc23474ac66af0dbd78cca0a48759ddf95cab6762bb17b24b4d1a376ad8cfdd4042fda  knot-resolver-4.2.2.tar.xz
688aeacb0c1f21c7e532533b402e67068897217713fb668636df7533000b493981ddfa0497f8dba7da7c804ee4ab8d587a4f52155b4e2bf1f4025d2588d314bb  knot-resolver.logrotate
9a4af28918d85fb973739cc856ac32c07746e4b1b2daee343905d5956bfd6cc45bf5cba87efa56625a9b38aced43aafb793ab37f9a2c06c95a899e47c84ee5a2  knot-resolver.confd
5891eb694f49ff221233afb0e4d7dcc5879783c3e365732189b623886b3a8351af022d80775bddf25e39f8b930ce9fccaed87384ee793e2746518ec5f3b78324  knot-resolver.initd"