aboutsummaryrefslogtreecommitdiffstats
path: root/community/kea/APKBUILD
blob: ba9705f3ce34270b80a4a6d5271d093319f85605 (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# Maintainer: Steve Holweg <skytep@gmail.com>
# Contributor: Baptiste Jonglez <baptiste--aur@jonglez.org>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
pkgname=kea
pkgver=1.7.2
pkgrel=3
pkgdesc="DHCPv4 and DHCPv6 server from ISC"
url="http://kea.isc.org"
# armhf, armv7: limited by log4cplus
# s390x: tests fail
arch="all !armhf !armv7 !s390x"
license="MPL2"
depends="kea-dhcp4 kea-dhcp6"
checkdepends="procps"
makedepends="
	bison
	boost-dev
	botan-dev
	flex
	libcap
	log4cplus-dev
	mariadb-dev
	postgresql-dev
	python3-dev
	"
pkgusers="kea"
pkggroups="kea"
install="$pkgname-common.pre-install"
subpackages="
	$pkgname-doc
	$pkgname-static
	$pkgname-dev
	$pkgname-admin::noarch
	$pkgname-ctrl-agent:ctrlagent
	$pkgname-dhcp-ddns:dhcpddns
	$pkgname-dhcp4
	$pkgname-dhcp6
	$pkgname-hooks
	$pkgname-http
	$pkgname-keactrl::noarch
	$pkgname-shell::noarch
	$pkgname-utils
	$pkgname-common
	"
source="https://ftp.isc.org/isc/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz
	disable-db-tests.patch
	logs-location.patch
	use-runstatedir-for-pid-file-location.patch
	put-LOCKFILE_DIR-to-runstatedir.patch
	kea-admin-remove-builddir.patch
	kea.initd.in
	"
validpgpkeys="BE0E9748B718253A28BB89FFF1B11BF05CF02E57" # Internet Systems Consortium, Inc. (Signing key, 2017-2018) <codesign@isc.org>

prepare() {
	default_prepare

	# Remove the builddir path from the scripts.
	# NOTE: There's a new script each release, so using patch file would be
	# very inconvenient.
	find src/share/database/scripts/ \
		-name '*.sh.in' \
		-exec sed -i 's|^\s*. @abs_top_builddir@/src/bin/admin/admin-utils.sh.*|echo "admin-utils.sh not found!"; exit 1|' {} \;
}

build() {
	# Complete build for dev and doc

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--libexecdir=/usr/lib \
		--runstatedir=/run \
		--with-mysql \
		--with-pgsql \
		--disable-rpath \
		--enable-generate-messages \
		--enable-generate-parser \
		--enable-shell
	make
}

check() {
	make check
}

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

	cd "$pkgdir"

	# Allow kea to run under unpriviliged user.
	local name; for name in kea-dhcp-ddns kea-dhcp4 kea-dhcp6; do
		setcap 'cap_net_bind_service=+ep' ./usr/sbin/$name
	done
	setcap 'cap_net_raw=+ep' ./usr/sbin/kea-dhcp6

	install -d -m 0750 -o kea -g kea \
		"$pkgdir"/var/log/kea \
		"$pkgdir"/var/lib/kea

	rm -Rf ./run
}

admin() {
	pkgdesc="Databases administration tools for Kea DHCP server"
	depends="$pkgname-common=$pkgver-r$pkgrel"

	amove ./usr/sbin/kea-admin
	amove ./usr/share/kea/
}

ctrlagent() {
	pkgdesc="Kea Control Agent - REST service for controlling Kea DHCP server"
	depends="$pkgname-common=$pkgver-r$pkgrel"

	amove usr/sbin/kea-ctrl-agent
	amove ./etc/kea/kea-ctrl-agent.conf

	_install_initd kea-ctrl-agent
}

dhcpddns() {
	pkgdesc="Kea DHCP Dynamic DNS Server"
	depends="$pkgname-common=$pkgver-r$pkgrel"

	amove ./usr/sbin/kea-dhcp-ddns
	amove ./etc/kea/kea-dhcp-ddns.conf
	amove ./usr/lib/libkea-asiodns.so.*

	_install_initd kea-dhcp-ddns
}

dhcp4() {
	pkgdesc="Kea IPv4 DHCP Server"
	depends="$pkgname-common=$pkgver-r$pkgrel"

	amove ./usr/sbin/kea-dhcp4
	amove ./etc/kea/kea-dhcp4.conf

	_install_initd kea-dhcp4
}

dhcp6() {
	pkgdesc="Kea IPv6 DHCP Server"
	depends="$pkgname-common=$pkgver-r$pkgrel"

	amove ./usr/sbin/kea-dhcp6
	amove ./etc/kea/kea-dhcp6.conf

	_install_initd kea-dhcp6
}

hooks() {
	pkgdesc="Hooks libraries for Kea DHCP server"
	depends=""

	amove ./usr/lib/kea/hooks/
}

# Needed only by ctrl-agent and hooks.
http() {
	depends=""

	amove ./usr/lib/libkea-http.so*
}

keactrl() {
	pkgdesc="Kea DHCP Process Manager"
	depends=""

	amove ./usr/sbin/keactrl
	amove ./etc/kea/keactrl.conf
}

shell() {
	pkgdesc="Text client for Kea DHCP Control Agent"
	depends="python3"

	amove ./usr/sbin/kea-shell
	amove ./usr/lib/python3*
}

utils() {
	pkgdesc="Optional utilities for Kea DHCP Server"
	depends=""

	amove ./usr/sbin/kea-lfc
}

common() {
	pkgdesc="Common files and libraries for Kea DHCP Server"
	depends=""

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

_install_initd() {
	local name="$1"

	install -Dm755 "$srcdir"/kea.initd.in "$subpkgdir"/etc/init.d/$name
	sed -i "s|@@NAME@@|$name|g" "$subpkgdir"/etc/init.d/$name
}

sha512sums="f84bed2e1dacd172c7aed8e4d6c11ec5e79f37ad2c7991963fc9c4a1761668f9f0e105ba5c4deed06264ab2ec13b1b5787350d823de12fd3782223192e3653f2  kea-1.7.2.tar.gz
55780bbcbd79b81d55bdccd46da6ca6babe8b7894aa82948308dc4f8a0e2b5d33fad633276696c8ba7bd063026bb11ae529a096375d0572833c66e2132888775  disable-db-tests.patch
4336bb6708d51729065da4dd3a3e96bbcbac7716b4bbde360af3c4599719c2fa9362055ae6c00043e7581f2f4af5a51d24f2e8cfaabefdb1f4d545c24af33f94  logs-location.patch
574b4aacef03c2d4a556b4ff8b152b66efd6fdc27ad09373d41c72df15f8a2cd2386e0bbe7e07f1370d9cd11e0954fc679f3d57e6b647d601cc06e0c63bc8712  use-runstatedir-for-pid-file-location.patch
062e6eb88c49aeeac5d78c37c43cda1ff753e19f833aaa1525e37f66eede819910d4849bd954f3ef8ceb1b13e747953c99e2a9a4d9755b6da8d82c4e08b2b55c  put-LOCKFILE_DIR-to-runstatedir.patch
5b93d96f2cbdce327ffceef5ace19ba5327a0c7d0d61714e35a0d72912ecbbec6a1864249612b48f8db20dffc3622170c3e21b1a67297fd834f47b94db85b9d7  kea-admin-remove-builddir.patch
57bed5c19aeb03218228a0b1244e7036ed80eaacb55e9799c9ba86619662f34c858512212b69b30c11b9b592ff776a82193ccd6fccffb6b3daa016e6d9197528  kea.initd.in"