APKBUILD 2.89 KB
Newer Older
1 2 3
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=knot-resolver
4
pkgver=3.2.1
5
pkgrel=0
6 7
pkgdesc="Minimalistic caching DNS resolver implementation"
url="https://www.knot-resolver.cz/"
8
# luajit is not available for disabled arches
9
arch="all !s390x"
10
license="GPL-3.0"
TBK's avatar
TBK committed
11 12
pkgusers="kresd"
pkggroups="kresd"
13
depends="lua5.1-sec lua5.1-socket"
14 15
depends_dnstap=""
depends_dnstap_dev="fstrm-dev protobuf-c-dev"
16
depends_http="$pkgname lua5.1-http"
17
depends_dev="knot-dev>=2.7.2 libedit-dev libuv-dev luajit-dev $depends_dnstap_dev"
18
makedepends="$depends_dev bash dnssec-root vim"
tcely's avatar
tcely committed
19
checkdepends="cmocka-dev"
20
install="$pkgname.pre-install"
21
subpackages="$pkgname-mod-http:http:noarch $pkgname-mod-dnstap:dnstap $pkgname-dev $pkgname-doc $pkgname-openrc"
22 23 24 25
source="https://secure.nic.cz/files/$pkgname/$pkgname-$pkgver.tar.xz
	$pkgname.initd
	$pkgname.confd
	$pkgname.logrotate
26
	config"
TBK's avatar
TBK committed
27 28 29 30

# secfixes:
#   2.3.0-r0:
#     - CVE-2018-1110
31 32 33 34 35 36 37 38 39

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

build() {
	cd "$builddir"
	make $_flags
}

tcely's avatar
tcely committed
40 41 42 43 44
check() {
	cd "$builddir"
	make $_flags -j1 check
}

45
package() {
tcely's avatar
tcely committed
46 47
	cd "$builddir"
	make $_flags DESTDIR="$pkgdir" install
48 49 50 51 52

	cd "$pkgdir"

	# Move sample configs to -doc.
	mkdir -p ./usr/share/doc/$pkgname
53
	mv ./etc/$pkgname/config* ./usr/share/doc/$pkgname/
tcely's avatar
tcely committed
54
	chmod 644 ./usr/share/doc/$pkgname/*
55 56

	install -m 640 -o root -g kresd "$srcdir"/config \
tcely's avatar
tcely committed
57
		./etc/$pkgname/config
58

tcely's avatar
tcely committed
59
	install -m 755 -o kresd -g kresd -d ./var/lib/$pkgname
60
	install -m 644 -o kresd -D /usr/share/dnssec-root/trusted-key.key \
tcely's avatar
tcely committed
61
		./var/lib/$pkgname/root.keys
62

tcely's avatar
tcely committed
63 64
	install -m 755 -D "$srcdir"/$pkgname.initd ./etc/init.d/$pkgname
	install -m 644 -D "$srcdir"/$pkgname.confd ./etc/conf.d/$pkgname
65 66 67 68 69

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

http() {
70 71
	pkgdesc="Knot Resolver - HTTP/2 services"
	depends="$depends_http"
72 73 74 75 76 77
	local moddir="usr/lib/kdns_modules"

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

78 79 80 81 82 83 84 85 86
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/
}

87
sha512sums="2ed79176183a685bf6365081706e68e4add05965a5f53a6f38ae4a5c204d29952eaf511ffbf18c646a0a843a032b425eb0592de27dafbf977d976946a3437351  knot-resolver-3.2.1.tar.xz
88 89 90
0e9b947ed0fe39a600ba8fe3cdeacf07521cdd6c371007dd15524f67c75ea024994a8c11820d70c57ef180c90f492eae69ef167152ad84c24a47c885710a7974  knot-resolver.initd
9d0d629405df243dc0f782abd6fcaaaf13fbce78d881f7ce213cfd2a55cfbfd87af2ba976061bf7b5d3d055edec98b42632395390f2a469648c27f96124997a6  knot-resolver.confd
688aeacb0c1f21c7e532533b402e67068897217713fb668636df7533000b493981ddfa0497f8dba7da7c804ee4ab8d587a4f52155b4e2bf1f4025d2588d314bb  knot-resolver.logrotate
91
913a557dde84e9dac7c7300ab093285865fa57f3875fc357e680f04a0e85af6610a0e33da6262431cbb06a2c5a115952e742e48c8568d4eb82182906170b4a73  config"