aboutsummaryrefslogtreecommitdiffstats
path: root/main/knot/APKBUILD
blob: ea24d86b8c53cdb56585349446a373fa4a597b08 (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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Contributor: Dennis Przytarski <dennis@przytarski.com>
# Contributor: Francesco Zanini <francesco@zanini.me>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=knot
pkgver=3.1.4
pkgrel=0
pkgdesc="An high-performance authoritative-only DNS server"
url="https://www.knot-dns.cz/"
# testsuite fails on 32 bit arches with musl 1.2
arch="all !x86 !armhf !armv7"
license="GPL-3.0-or-later"
depends_dev="
	$pkgname=$pkgver-r$pkgrel
	$pkgname-libs-static=$pkgver-r$pkgrel
	$pkgname-utils=$pkgver-r$pkgrel
	"
checkdepends="softhsm"
makedepends="
	bison
	bsd-compat-headers
	flex
	fstrm-dev
	gnutls-dev
	jansson-dev
	libcap-ng-dev
	libedit-dev
	libidn-dev
	libtool
	lmdb-dev
	m4
	libmaxminddb-dev
	nghttp2-dev
	openssl1.1-compat-dev
	perl
	protobuf-c-dev
	sed
	userspace-rcu-dev
	zlib-dev
	"
install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
pkgusers="knot"
pkggroups="knot"
subpackages="
	$pkgname-mod-dnstap:_module
	$pkgname-mod-geoip:_module
	$pkgname-libs
	$pkgname-libs-static
	$pkgname-utils
	$pkgname-dev
	$pkgname-doc
	$pkgname-openrc
	"
source="https://secure.nic.cz/files/$pkgname-dns/$pkgname-$pkgver.tar.xz
	knotd.confd
	knotd.initd
	"

# tests fail due to alignment problems on armv6
[ "$CARCH" = "armhf" ] && options="!check"

# link against gcc libatomic on riscv64
[ "$CARCH" = "riscv64" ] && export LDFLAGS="$LDFLAGS -latomic"

prepare() {
	default_prepare

	cd "$builddir"
	# Make sure embedded LMDB library is not used.
	rm -rf src/contrib/lmdb
}

build() {
	./configure \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr \
		--sysconfdir=/etc \
		--libexecdir="/usr/lib/$pkgname" \
		--enable-maxminddb \
		--with-rundir="/run/$pkgname" \
		--with-storage="/var/lib/$pkgname" \
		--with-module-dnstap=shared \
		--with-module-geoip=shared \
		--disable-silent-rules
	make
}

check() {
	make check
}

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

	rm -rf "$pkgdir"/run
	install -d -m750 -o knot -g knot "$pkgdir"/var/lib/$pkgname

	install -D -m755 "$srcdir"/knotd.initd "$pkgdir"/etc/init.d/knotd
	install -D -m644 "$srcdir"/knotd.confd "$pkgdir"/etc/conf.d/knotd
}

libs() {
	pkgdesc="Libraries used by the Knot DNS server and client applications"

	amove usr/lib/libdnssec.so.*
	amove usr/lib/libknot.so.*
	amove usr/lib/libzscanner.so.*
}

utils() {
	pkgdesc="Knot and DNS client utilities shipped with the Knot DNS server"

	amove usr/bin
	amove usr/sbin/keymgr
	amove usr/sbin/kjournalprint
	amove usr/sbin/kcatalogprint
}

_module() {
	local modname=${subpkgname#$pkgname-mod-}
	pkgdesc="$modname module for Knot DNS"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove usr/lib/$pkgname/modules-${pkgver%.*}/$modname.so
}

gpg_signature_extensions="asc"
gpgfingerprints="good:742F A4E9 5829 B6C5 EAC6  B857 10BB 7AF6 FEBB D6AB"

sha512sums="
307667a12b989fee443832d4642fc927231f38f0331439c8c7196c489d196245eca368d96a36fe49639b773f652f7cb80bf0c16bc1ad107e11b47b70e1f04060  knot-3.1.4.tar.xz
471d3c639a8235ba09491c99d36c0a4f1074d6055ccfd3807be02a30d3ed5bbe69a84f0414ea7810db6bbc1e38f5837108e5744fc59f949ed78a262a7de4597e  knotd.confd
979f06a83dd4326920a682f8190319577faf904e0e379b3c55e0420eb43dcb55d86c6727015634fa0c2dff1dddac43bbd5a216ff04f217ad91d670eb899dbefa  knotd.initd
"