aboutsummaryrefslogtreecommitdiff
path: root/net/kea/Makefile
blob: c44c088e800f41be6ec53e807eabde698910b380 (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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
#
# Copyright (C) 2019 Banglang Huang <banglang.huang@foxmail.com>
# Copyright (C) 2019 Rosy Song <rosysong@rosinson.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=kea
PKG_VERSION:=2.4.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://ftp.isc.org/isc/kea/$(PKG_VERSION)
PKG_HASH:=3a33cd08dc3319ff544e6bbf2c0429042106f4051ebe115dc1bb2625c95003f7

PKG_MAINTAINER:=BangLang Huang <banglang.huang@foxmail.com>, Rosy Song <rosysong@rosinson.com>
PKG_LICENSE:=MPL-2.0
PKG_LICENSE_FILES:=COPYING

PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=gc-sections

PKG_INSTALL:=1
PKG_FIXUP:=autoreconf

include $(INCLUDE_DIR)/package.mk

define Package/kea/Default
  SECTION:=net
  CATEGORY:=Network
  SUBMENU:=IP Addresses and Names
  TITLE:=ISC Kea
  URL:=https://www.isc.org/kea
endef

define Package/kea/conffiles
/etc/kea/
endef

Package/kea-ctrl/conffiles = $(Package/kea/conffiles)
Package/kea-dhcp4/conffiles = $(Package/kea/conffiles)
Package/kea-dhcp6/conffiles = $(Package/kea/conffiles)
Package/kea-dhcp-ddns/conffiles = $(Package/kea/conffiles)

###### *************************************************************************
define Package/kea
	$(call Package/kea/Default)
  TITLE+=ISC Kea
endef
# shown in LuCI package description
define Package/kea/description
  Kea is an open source DHCPv4/DHCPv6 server being developed by Internet
  Systems Consortium. Kea is a high-performance, extensible DHCP server
  engine that is designed to be easily modified and extended with hooks
  libraries. It provides DHCPv4 and DHCPv6 servers, a dynamic DNS update
  module, a portable DHCP library, libdhcp++, control agent that provides
  management REST interface, and a DHCP benchmarking tool, perfdhcp.
endef

###### *************************************************************************
define Package/kea-libs
	$(call Package/kea/Default)
	TITLE+=Libraries
	DEPENDS:=+libopenssl +log4cplus \
	+boost +boost-system
endef
define Package/kea-libs/description
		Kea required Libraries.
endef

###### *************************************************************************
define Package/kea-ctrl
	$(call Package/kea/Default)
	TITLE+=Control
	DEPENDS:=+procps-ng +procps-ng-ps +kea-dhcp4 \
	+IPV6:kea-dhcp6 +kea-dhcp-ddns
endef
define Package/kea-ctrl/description
	Tool to start, stop, reconfigure, and report status for the Kea servers.
endef

###### *************************************************************************
define Package/kea-dhcp4
	$(call Package/kea/Default)
	TITLE+=DHCP Server v4
	DEPENDS:=+kea-libs
endef
define Package/kea-dhcp4/description
    The DHCPv4 server process. This process responds to DHCPv4 queries from clients.
endef

###### *************************************************************************
define Package/kea-dhcp6
	$(call Package/kea/Default)
	TITLE+=DHCP Server v6
	DEPENDS:=@IPV6 +kea-libs
endef
define Package/kea-dhcp6/description
    The DHCPv6 server process. This process responds to DHCPv6 queries from clients.
endef

###### *************************************************************************
define Package/kea-dhcp-ddns
	$(call Package/kea/Default)
	TITLE+=DHCP Dynamic DNS
	DEPENDS:=+kea-libs
endef
define Package/kea-dhcp-ddns/description
		The DHCP Dynamic DNS process. This process acts as an intermediary between
the DHCP servers and DNS servers. It receives name update requests from the
DHCP servers and sends DNS Update messages to the DNS servers.
endef

###### *************************************************************************
define Package/kea-admin
	$(call Package/kea/Default)
	TITLE+=Admin
	DEPENDS:=+kea-libs
endef
define Package/kea-admin/description
   	A useful tool for database backend maintenance (creating a new database,
checking versions, upgrading etc.).
endef

###### *************************************************************************
define Package/kea-hook-ha
	$(call Package/kea/Default)
	TITLE+=High Availability hook library
	DEPENDS:=+kea-libs +kea-hook-lease-cmds
endef
define Package/kea-hook-ha/description
	The high availability hook library.
endef

###### *************************************************************************
define Package/kea-hook-lease-cmds
	$(call Package/kea/Default)
	TITLE+=Lease Commands hook library
	DEPENDS:=+kea-libs
endef
define Package/kea-hook-lease-cmds/description
	The lease commands hook library.
endef

##### *************************************************************************
define Package/kea-lfc
	$(call Package/kea/Default)
	TITLE+=lfc
	DEPENDS:=+kea-libs
endef
define Package/kea-lfc/description
    This process removes redundant information from the files used to provide
persistent storage for the memfile data base backend. While it can be run
standalone, it is normally run as and when required by the Kea DHCP servers.
endef

##### *************************************************************************
define Package/kea-perfdhcp
	$(call Package/kea/Default)
	TITLE+=perfdhcp (Benchmarking)
	DEPENDS:=+kea-libs
endef
define Package/kea-perfdhcp/description
     A DHCP benchmarking tool which simulates multiple clients to test both
DHCPv4 and DHCPv6 server performance.
endef

###### *************************************************************************
define Package/kea-shell
	$(call Package/kea/Default)
	TITLE+=shell
	DEPENDS:=+kea-libs
endef
define Package/kea-shell/description
     This simple text client uses the REST interface to connect to the Kea
Control Agent.
endef

###### *************************************************************************
define Package/kea-uci
	$(call Package/kea/Default)
	TITLE+=UCI support
	DEPENDS:=@(PACKAGE_kea-ctrl||PACKAGE_kea-dhcp4||PACKAGE_kea-dhcp6||PACKAGE_kea-dhcp-ddns)
endef
define Package/kea-uci/description
	Kea PROCD/UCI support. This package installs a UCI config file and
	a PROCD service file.
endef

###### *************************************************************************

CONFIGURE_ARGS += \
	--with-boost-include="$(STAGING_DIR)/usr" \
	--with-log4cplus="$(STAGING_DIR)/usr" \
	--with-openssl="$(STAGING_DIR)/usr" \
	--without-pic \
	$(if $(CONFIG_PACKAGE_kea-perfdhcp),--enable-perfdhcp,) \
	$(if $(CONFIG_PACKAGE_kea-shell),--enable-shell,)

CONFIGURE_VARS += \
	cross_compiling="yes"

TARGET_CXXFLAGS += \
	$(FPIC) \
	-std=c++17

TARGET_LDFLAGS += \
	-Wl,--as-needed

define Package/kea-libs/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
endef

define Package/kea-dhcp4/install
	$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp4 $(1)/usr/sbin/kea-dhcp4
	$(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp4.conf $(1)/etc/kea/
endef

define Package/kea-dhcp6/install
	$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp6 $(1)/usr/sbin/kea-dhcp6
	$(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp6.conf $(1)/etc/kea/
endef

define Package/kea-dhcp-ddns/install
	$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp-ddns $(1)/usr/sbin/kea-dhcp-ddns
	$(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp-ddns.conf $(1)/etc/kea/
endef

define Package/kea-admin/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
endef

define Package/kea-hook-ha/install
	$(INSTALL_DIR) $(1)/usr/lib/kea/hooks
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/kea/hooks/libdhcp_ha.so $(1)/usr/lib/kea/hooks
endef

define Package/kea-hook-lease-cmds/install
	$(INSTALL_DIR) $(1)/usr/lib/kea/hooks
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/kea/hooks/libdhcp_lease_cmds.so $(1)/usr/lib/kea/hooks
endef

define Package/kea-ctrl/install
	$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keactrl $(1)/usr/sbin/keactrl
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-ctrl-agent $(1)/usr/sbin/kea-ctrl-agent
	$(CP) $(PKG_INSTALL_DIR)/etc/kea/keactrl.conf $(1)/etc/kea/
	$(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-ctrl-agent.conf $(1)/etc/kea/
endef

define Package/kea-lfc/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-lfc $(1)/usr/sbin/kea-lfc
endef

define Package/kea-perfdhcp/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/perfdhcp $(1)/usr/sbin/perfdhcp
endef

define Package/kea-shell/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-shell $(1)/usr/sbin/kea-shell
endef

define Package/kea-uci/install
	$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
	$(INSTALL_CONF) ./files/kea.config $(1)/etc/config/kea
	$(INSTALL_BIN) ./files/kea.init $(1)/etc/init.d/kea
endef

define Package/kea-uci/conffiles
/etc/config/kea
endef

$(eval $(call HostBuild))
$(eval $(call BuildPackage,kea-libs))
$(eval $(call BuildPackage,kea-ctrl))
$(eval $(call BuildPackage,kea-dhcp4))
$(eval $(call BuildPackage,kea-dhcp6))
$(eval $(call BuildPackage,kea-dhcp-ddns))
$(eval $(call BuildPackage,kea-admin))
$(eval $(call BuildPackage,kea-hook-ha))
$(eval $(call BuildPackage,kea-hook-lease-cmds))
$(eval $(call BuildPackage,kea-lfc))
$(eval $(call BuildPackage,kea-perfdhcp))
$(eval $(call BuildPackage,kea-shell))
$(eval $(call BuildPackage,kea-uci))