kea: add conffiles
[feed/packages.git] / net / kea / Makefile
1 #
2 # Copyright (C) 2019 Banglang Huang <banglang.huang@foxmail.com>
3 # Copyright (C) 2019 Rosy Song <rosysong@rosinson.com>
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=kea
12 PKG_VERSION:=1.8.2
13 PKG_RELEASE:=$(AUTORELEASE)
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=https://ftp.isc.org/isc/kea/$(PKG_VERSION)
17 PKG_HASH:=486ca7abedb9d6fdf8e4344ad8688d1171f2ef0f5506d118988aadeae80a1d39
18
19 PKG_MAINTAINER:=BangLang Huang<banglang.huang@foxmail.com>, Rosy Song<rosysong@rosinson.com>
20 PKG_LICENSE:=MPL-2.0
21 PKG_LICENSE_FILES:=COPYING
22
23 HOST_BUILD_DEPENDS:=boost/host log4cplus/host
24 PKG_BUILD_DEPENDS:=kea/host
25 HOST_BUILD_PARALLEL:=1
26 PKG_BUILD_PARALLEL:=1
27
28 PKG_INSTALL:=1
29 PKG_FIXUP:=autoreconf
30
31 include $(INCLUDE_DIR)/package.mk
32 include $(INCLUDE_DIR)/host-build.mk
33
34 define Package/kea/Default
35 SECTION:=net
36 CATEGORY:=Network
37 SUBMENU:=IP Addresses and Names
38 TITLE:=ISC Kea
39 URL:=https://www.isc.org/kea
40 endef
41
42 define Package/kea/conffiles
43 /etc/kea/
44 endef
45
46 Package/kea-ctrl/conffiles = $(Package/kea/conffiles)
47 Package/kea-dhcp4/conffiles = $(Package/kea/conffiles)
48 Package/kea-dhcp6/conffiles = $(Package/kea/conffiles)
49 Package/kea-dhcp-ddns/conffiles = $(Package/kea/conffiles)
50
51 ###### *************************************************************************
52 define Package/kea
53 $(call Package/kea/Default)
54 TITLE+=ISC Kea
55 endef
56 # shown in LuCI package description
57 define Package/kea/description
58 Kea is an open source DHCPv4/DHCPv6 server being developed by Internet
59 Systems Consortium. Kea is a high-performance, extensible DHCP server
60 engine that is designed to be easily modified and extended with hooks
61 libraries. It provides DHCPv4 and DHCPv6 servers, a dynamic DNS update
62 module, a portable DHCP library, libdhcp++, control agent that provides
63 management REST interface, and a DHCP benchmarking tool, perfdhcp.
64 endef
65
66 ###### *************************************************************************
67 define Package/kea-libs
68 $(call Package/kea/Default)
69 TITLE+=Libraries
70 DEPENDS:=+libopenssl +log4cplus \
71 +boost +boost-system
72 endef
73 define Package/kea-libs/description
74 Kea required Libraries.
75 endef
76
77 ###### *************************************************************************
78 define Package/kea-ctrl
79 $(call Package/kea/Default)
80 TITLE+=Control
81 DEPENDS:=+procps-ng +procps-ng-ps +kea-dhcp4 \
82 +IPV6:kea-dhcp6 +kea-dhcp-ddns
83 endef
84 define Package/kea-ctrl/description
85 Tool to start, stop, reconfigure, and report status for the Kea servers.
86 endef
87
88 ###### *************************************************************************
89 define Package/kea-dhcp4
90 $(call Package/kea/Default)
91 TITLE+=DHCP Server v4
92 DEPENDS:=+kea-libs
93 endef
94 define Package/kea-dhcp4/description
95 The DHCPv4 server process. This process responds to DHCPv4 queries from clients.
96 endef
97
98 ###### *************************************************************************
99 define Package/kea-dhcp6
100 $(call Package/kea/Default)
101 TITLE+=DHCP Server v6
102 DEPENDS:=@IPV6 +kea-libs
103 endef
104 define Package/kea-dhcp6/description
105 The DHCPv6 server process. This process responds to DHCPv6 queries from clients.
106 endef
107
108 ###### *************************************************************************
109 define Package/kea-dhcp-ddns
110 $(call Package/kea/Default)
111 TITLE+=DHCP Dynamic DNS
112 DEPENDS:=+kea-libs
113 endef
114 define Package/kea-dhcp-ddns/description
115 The DHCP Dynamic DNS process. This process acts as an intermediary between
116 the DHCP servers and DNS servers. It receives name update requests from the
117 DHCP servers and sends DNS Update messages to the DNS servers.
118 endef
119
120 ###### *************************************************************************
121 define Package/kea-admin
122 $(call Package/kea/Default)
123 TITLE+=Admin
124 DEPENDS:=+kea-libs
125 endef
126 define Package/kea-admin/description
127 A useful tool for database backend maintenance (creating a new database,
128 checking versions, upgrading etc.).
129 endef
130
131 ###### *************************************************************************
132 define Package/kea-hook-ha
133 $(call Package/kea/Default)
134 TITLE+=High Availability hook library
135 DEPENDS:=+kea-libs +kea-hook-lease-cmds
136 endef
137 define Package/kea-hook-ha/description
138 The high availability hook library.
139 endef
140
141 ###### *************************************************************************
142 define Package/kea-hook-lease-cmds
143 $(call Package/kea/Default)
144 TITLE+=Lease Commands hook library
145 DEPENDS:=+kea-libs
146 endef
147 define Package/kea-hook-lease-cmds/description
148 The lease commands hook library.
149 endef
150
151 ##### *************************************************************************
152 define Package/kea-lfc
153 $(call Package/kea/Default)
154 TITLE+=lfc
155 DEPENDS:=+kea-libs
156 endef
157 define Package/kea-lfc/description
158 This process removes redundant information from the files used to provide
159 persistent storage for the memfile data base backend. While it can be run
160 standalone, it is normally run as and when required by the Kea DHCP servers.
161 endef
162
163 ##### *************************************************************************
164 define Package/kea-perfdhcp
165 $(call Package/kea/Default)
166 TITLE+=perfdhcp (Benchmarking)
167 DEPENDS:=+kea-libs
168 endef
169 define Package/kea-perfdhcp/description
170 A DHCP benchmarking tool which simulates multiple clients to test both
171 DHCPv4 and DHCPv6 server performance.
172 endef
173
174 ###### *************************************************************************
175 define Package/kea-shell
176 $(call Package/kea/Default)
177 TITLE+=shell
178 DEPENDS:=+kea-libs
179 endef
180 define Package/kea-shell/description
181 This simple text client uses the REST interface to connect to the Kea
182 Control Agent.
183 endef
184
185 ###### *************************************************************************
186 HOST_CONFIGURE_ARGS += \
187 --with-boost-include="$(STAGING_DIR_HOSTPKG)" \
188 --with-log4cplus="$(STAGING_DIR_HOSTPKG)" \
189 --with-openssl="$(STAGING_DIR_HOST)" \
190 --enable-generate-messages
191
192 HOST_LDFLAGS += \
193 -Wl,--gc-sections,--as-needed
194
195 CONFIGURE_ARGS += \
196 --with-boost-include="$(STAGING_DIR)/usr" \
197 --with-log4cplus="$(STAGING_DIR)/usr" \
198 --with-openssl="$(STAGING_DIR)/usr" \
199 --without-pic \
200 $(if $(CONFIG_PACKAGE_kea-perfdhcp),--enable-perfdhcp,) \
201 $(if $(CONFIG_PACKAGE_kea-shell),--enable-shell,)
202
203 CONFIGURE_VARS += \
204 cross_compiling="yes"
205
206 TARGET_CXXFLAGS += \
207 $(FPIC) \
208 -fdata-sections \
209 -ffunction-sections \
210 -std=c++17
211
212 TARGET_LDFLAGS += \
213 -Wl,--gc-sections,--as-needed
214
215 # Only compile the kea-msg-compiler which we need for
216 # package compilation
217 define Host/Compile
218 +$(HOST_MAKE_VARS) \
219 $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/exceptions $(HOST_MAKE_FLAGS)
220 +$(HOST_MAKE_VARS) \
221 $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/util $(HOST_MAKE_FLAGS)
222 +$(HOST_MAKE_VARS) \
223 $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/log $(HOST_MAKE_FLAGS)
224 endef
225
226 define Host/Install
227 $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/lib/log/compiler/kea-msg-compiler \
228 $(STAGING_DIR_HOSTPKG)/bin/
229 endef
230
231 define Build/Compile
232 $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/lib/log/compiler
233 $(INSTALL_BIN) $(STAGING_DIR_HOSTPKG)/bin/kea-msg-compiler \
234 $(PKG_BUILD_DIR)/src/lib/log/compiler/
235 $(call Build/Compile/Default)
236 endef
237
238 define Package/kea-libs/install
239 $(INSTALL_DIR) $(1)/usr/lib
240 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
241 endef
242
243 define Package/kea-dhcp4/install
244 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
245 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp4 $(1)/usr/sbin/kea-dhcp4
246 $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp4.conf $(1)/etc/kea/
247 endef
248
249 define Package/kea-dhcp6/install
250 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
251 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp6 $(1)/usr/sbin/kea-dhcp6
252 $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp6.conf $(1)/etc/kea/
253 endef
254
255 define Package/kea-dhcp-ddns/install
256 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
257 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp-ddns $(1)/usr/sbin/kea-dhcp-ddns
258 $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp-ddns.conf $(1)/etc/kea/
259 endef
260
261 define Package/kea-admin/install
262 $(INSTALL_DIR) $(1)/usr/sbin
263 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
264 endef
265
266 define Package/kea-hook-ha/install
267 $(INSTALL_DIR) $(1)/usr/lib/kea/hooks
268 $(CP) $(PKG_INSTALL_DIR)/usr/lib/kea/hooks/libdhcp_ha.so $(1)/usr/lib/kea/hooks
269 endef
270
271 define Package/kea-hook-lease-cmds/install
272 $(INSTALL_DIR) $(1)/usr/lib/kea/hooks
273 $(CP) $(PKG_INSTALL_DIR)/usr/lib/kea/hooks/libdhcp_lease_cmds.so $(1)/usr/lib/kea/hooks
274 endef
275
276 define Package/kea-ctrl/install
277 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
278 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keactrl $(1)/usr/sbin/keactrl
279 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-ctrl-agent $(1)/usr/sbin/kea-ctrl-agent
280 $(CP) $(PKG_INSTALL_DIR)/etc/kea/keactrl.conf $(1)/etc/kea/
281 $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-ctrl-agent.conf $(1)/etc/kea/
282 endef
283
284 define Package/kea-lfc/install
285 $(INSTALL_DIR) $(1)/usr/sbin
286 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-lfc $(1)/usr/sbin/kea-lfc
287 endef
288
289 define Package/kea-perfdhcp/install
290 $(INSTALL_DIR) $(1)/usr/sbin
291 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/perfdhcp $(1)/usr/sbin/perfdhcp
292 endef
293
294 define Package/kea-shell/install
295 $(INSTALL_DIR) $(1)/usr/sbin
296 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-shell $(1)/usr/sbin/kea-shell
297 endef
298
299 $(eval $(call HostBuild))
300 $(eval $(call BuildPackage,kea-libs))
301 $(eval $(call BuildPackage,kea-ctrl))
302 $(eval $(call BuildPackage,kea-dhcp4))
303 $(eval $(call BuildPackage,kea-dhcp6))
304 $(eval $(call BuildPackage,kea-dhcp-ddns))
305 $(eval $(call BuildPackage,kea-admin))
306 $(eval $(call BuildPackage,kea-hook-ha))
307 $(eval $(call BuildPackage,kea-hook-lease-cmds))
308 $(eval $(call BuildPackage,kea-lfc))
309 $(eval $(call BuildPackage,kea-perfdhcp))
310 $(eval $(call BuildPackage,kea-shell))