aboutsummaryrefslogtreecommitdiffstats
path: root/community/knot-resolver/APKBUILD
blob: 141aba56b29ee953dda6d967d4602a48b972beb0 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: tcely <knot-resolver+aports@tcely.33mail.com>
# Maintainer: tcely <knot-resolver+aports@tcely.33mail.com>
pkgname="knot-resolver"
_pkgname="${pkgname}"
pkgver="4.1.0"
pkgrel=0
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 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"
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-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
	4A8B A48C 2AED 933B D495  C509 A1FB A5F7 EF8C 4869
	B600 6460 B60A 80E7 8206  2449 E747 DF1F 9575 A3AA
	"

sha256sums="2fe470f9bb1007667cdd448f758087244b7195a0234c2b100a9beeed0a2d3e68  knot-resolver-4.1.0.tar.xz
1907cad39d355c03f84997272271933476d335b0e84c4f71490c98b7a2631f20  knot-resolver.logrotate
357a277602d998bebabb806178c96dd71dc14a73945000480788a9b5cef10a57  knot-resolver.confd
2c3978a7366a04aba7bac0308d778af4c93ca9497fe10bb96658050a3080cf62  knot-resolver.initd"
sha512sums="d9e86cea160f15e92908193613887bb7b727d0125b9de03e16c7bc66c0c29288621dd09b7208599f1f80ccb659f47179722df481565530c4c2532d9bd81fdd91  knot-resolver-4.1.0.tar.xz
688aeacb0c1f21c7e532533b402e67068897217713fb668636df7533000b493981ddfa0497f8dba7da7c804ee4ab8d587a4f52155b4e2bf1f4025d2588d314bb  knot-resolver.logrotate
0bfab48f3a182eb396c039c932698f9a4bb7d11f5ecd87336fe803cf6e0ef2923c2e516dc6a5cec19595945d24b3b24795d0119fb8560c42b0d268b2c3be6c20  knot-resolver.confd
902e7773c404ab4862453233e16ec8ccc415759d73aea795062e945034d28537b13397b14dec3b6ef8ec3ea58604e77258e1381e9b62d93ddb9ec3e3e0031244  knot-resolver.initd"