aboutsummaryrefslogtreecommitdiffstats
path: root/community/knot/APKBUILD
blob: f7507c70eea5230710f8f1ef7045ea5c8708eaea (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
106
107
108
109
110
111
112
113
114
115
116
117
118
# 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: Francesco Colista <fcolista@alpinelinux.org>
pkgname=knot
pkgver=2.3.1
pkgrel=0
pkgdesc="An high-performance authoritative-only DNS server"
url="https://www.knot-dns.cz"
arch="all"
license="GPL3"
depends=""
depends_dev="gnutls-dev libedit-dev libcap-ng-dev libidn-dev lmdb-dev
	libressl-dev userspace-rcu-dev zlib-dev"
makedepends="$depends_dev m4 bison flex perl jansson-dev libtool"
install="$pkgname.pre-install $pkgname.post-install knot.post-upgrade"
pkgusers="knot"
pkggroups="knot"
subpackages="$pkgname-libs
	$pkgname-utils
	$pkgname-bash-completion:bashcomp
	$pkgname-zsh-completion:zshcomp
	$pkgname-dev
	$pkgname-doc
	"
source="https://secure.nic.cz/files/knot-dns/$pkgname-$pkgver.tar.xz
	knotd.confd
	knotd.initd
	"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare || return 1

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

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--libexecdir=/usr/lib/knot \
		--with-rundir=/run/knot \
		--with-storage=/var/lib/knot \
		--disable-silent-rules \
		|| return 1
	make || return 1
	make check || return 1
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install || return 1

	rm -Rf "$pkgdir"/run
	chown $pkgusers:$pkggroups "$pkgdir"/var/lib/$pkgname || return 1
	chmod 750 "$pkgdir"/var/lib/$pkgname || return 1

	install -Dm 644 "$srcdir"/knotd.confd \
		"$pkgdir"/etc/conf.d/knotd || return 1
	install -Dm 755 "$srcdir"/knotd.initd \
		"$pkgdir"/etc/init.d/knotd || return 1
}

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

	cd "$pkgdir"
	mkdir -p "$subpkgdir"/usr/lib
	mv ./usr/lib/libdnssec.so.* \
		./usr/lib/libknot.so.* \
		./usr/lib/libzscanner.so.* \
		"$subpkgdir"/usr/lib/
}

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

	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

bashcomp() {
	pkgdesc="Bash completions for knot"
	arch="noarch"
	depends="bash"
	install_if="$pkgname=$pkgver-r$pkgrel bash"

	install -m 644 -D "$builddir"/samples/keymgr-completion.sh \
		"$subpkgdir"/usr/share/bash-completion/completions/keymgr
}

zshcomp() {
	pkgdesc="ZSH completions for knot"
	arch="noarch"
	depends="zsh"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	install -m 644 -D "$builddir"/samples/keymgr-completion.zsh \
		"$subpkgdir"/usr/share/zsh/site-functions/_keymgr
}

md5sums="e8e5529acd490c651c9de669637792a7  knot-2.3.1.tar.xz
66f3111080662280d95bc928d6ca92d5  knotd.confd
f79e35b48c3afc236cf7a9dc20dc3d11  knotd.initd"
sha256sums="42e4ec64dc8f017329d1753eb074a5759d6bb380e1f2a272101adccc0552f9b4  knot-2.3.1.tar.xz
ff384d428c9e67139ed21b0c78eabf6a26d96f31775f6143ce0c4f9c4f6beaf3  knotd.confd
da7b93cf442a3ede972d1239b40e2d5f07227e0a2846c2c7286c0f5f343f8284  knotd.initd"
sha512sums="10d8c09d7cce88aba95b067da9b138af710864de4ef9c00d7ab165b4aca621d9ff15a49b5102e0cdd7bfb14e2806ed8587fd138b6e6af74a01e26e6d6ffe1163  knot-2.3.1.tar.xz
471d3c639a8235ba09491c99d36c0a4f1074d6055ccfd3807be02a30d3ed5bbe69a84f0414ea7810db6bbc1e38f5837108e5744fc59f949ed78a262a7de4597e  knotd.confd
979f06a83dd4326920a682f8190319577faf904e0e379b3c55e0420eb43dcb55d86c6727015634fa0c2dff1dddac43bbd5a216ff04f217ad91d670eb899dbefa  knotd.initd"