uacme: Remove deprecated $(AUTORELEASE)
[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:=2.0.3
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:=d642907374d17480ebe4df805b363dc9e230a955475a9f3e04a076b52d5c43ec
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 PKG_BUILD_PARALLEL:=1
24
25 PKG_INSTALL:=1
26 PKG_FIXUP:=autoreconf
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/kea/Default
31 SECTION:=net
32 CATEGORY:=Network
33 SUBMENU:=IP Addresses and Names
34 TITLE:=ISC Kea
35 URL:=https://www.isc.org/kea
36 endef
37
38 define Package/kea/conffiles
39 /etc/kea/
40 endef
41
42 Package/kea-ctrl/conffiles = $(Package/kea/conffiles)
43 Package/kea-dhcp4/conffiles = $(Package/kea/conffiles)
44 Package/kea-dhcp6/conffiles = $(Package/kea/conffiles)
45 Package/kea-dhcp-ddns/conffiles = $(Package/kea/conffiles)
46
47 ###### *************************************************************************
48 define Package/kea
49 $(call Package/kea/Default)
50 TITLE+=ISC Kea
51 endef
52 # shown in LuCI package description
53 define Package/kea/description
54 Kea is an open source DHCPv4/DHCPv6 server being developed by Internet
55 Systems Consortium. Kea is a high-performance, extensible DHCP server
56 engine that is designed to be easily modified and extended with hooks
57 libraries. It provides DHCPv4 and DHCPv6 servers, a dynamic DNS update
58 module, a portable DHCP library, libdhcp++, control agent that provides
59 management REST interface, and a DHCP benchmarking tool, perfdhcp.
60 endef
61
62 ###### *************************************************************************
63 define Package/kea-libs
64 $(call Package/kea/Default)
65 TITLE+=Libraries
66 DEPENDS:=+libopenssl +log4cplus \
67 +boost +boost-system
68 endef
69 define Package/kea-libs/description
70 Kea required Libraries.
71 endef
72
73 ###### *************************************************************************
74 define Package/kea-ctrl
75 $(call Package/kea/Default)
76 TITLE+=Control
77 DEPENDS:=+procps-ng +procps-ng-ps +kea-dhcp4 \
78 +IPV6:kea-dhcp6 +kea-dhcp-ddns
79 endef
80 define Package/kea-ctrl/description
81 Tool to start, stop, reconfigure, and report status for the Kea servers.
82 endef
83
84 ###### *************************************************************************
85 define Package/kea-dhcp4
86 $(call Package/kea/Default)
87 TITLE+=DHCP Server v4
88 DEPENDS:=+kea-libs
89 endef
90 define Package/kea-dhcp4/description
91 The DHCPv4 server process. This process responds to DHCPv4 queries from clients.
92 endef
93
94 ###### *************************************************************************
95 define Package/kea-dhcp6
96 $(call Package/kea/Default)
97 TITLE+=DHCP Server v6
98 DEPENDS:=@IPV6 +kea-libs
99 endef
100 define Package/kea-dhcp6/description
101 The DHCPv6 server process. This process responds to DHCPv6 queries from clients.
102 endef
103
104 ###### *************************************************************************
105 define Package/kea-dhcp-ddns
106 $(call Package/kea/Default)
107 TITLE+=DHCP Dynamic DNS
108 DEPENDS:=+kea-libs
109 endef
110 define Package/kea-dhcp-ddns/description
111 The DHCP Dynamic DNS process. This process acts as an intermediary between
112 the DHCP servers and DNS servers. It receives name update requests from the
113 DHCP servers and sends DNS Update messages to the DNS servers.
114 endef
115
116 ###### *************************************************************************
117 define Package/kea-admin
118 $(call Package/kea/Default)
119 TITLE+=Admin
120 DEPENDS:=+kea-libs
121 endef
122 define Package/kea-admin/description
123 A useful tool for database backend maintenance (creating a new database,
124 checking versions, upgrading etc.).
125 endef
126
127 ###### *************************************************************************
128 define Package/kea-hook-ha
129 $(call Package/kea/Default)
130 TITLE+=High Availability hook library
131 DEPENDS:=+kea-libs +kea-hook-lease-cmds
132 endef
133 define Package/kea-hook-ha/description
134 The high availability hook library.
135 endef
136
137 ###### *************************************************************************
138 define Package/kea-hook-lease-cmds
139 $(call Package/kea/Default)
140 TITLE+=Lease Commands hook library
141 DEPENDS:=+kea-libs
142 endef
143 define Package/kea-hook-lease-cmds/description
144 The lease commands hook library.
145 endef
146
147 ##### *************************************************************************
148 define Package/kea-lfc
149 $(call Package/kea/Default)
150 TITLE+=lfc
151 DEPENDS:=+kea-libs
152 endef
153 define Package/kea-lfc/description
154 This process removes redundant information from the files used to provide
155 persistent storage for the memfile data base backend. While it can be run
156 standalone, it is normally run as and when required by the Kea DHCP servers.
157 endef
158
159 ##### *************************************************************************
160 define Package/kea-perfdhcp
161 $(call Package/kea/Default)
162 TITLE+=perfdhcp (Benchmarking)
163 DEPENDS:=+kea-libs
164 endef
165 define Package/kea-perfdhcp/description
166 A DHCP benchmarking tool which simulates multiple clients to test both
167 DHCPv4 and DHCPv6 server performance.
168 endef
169
170 ###### *************************************************************************
171 define Package/kea-shell
172 $(call Package/kea/Default)
173 TITLE+=shell
174 DEPENDS:=+kea-libs
175 endef
176 define Package/kea-shell/description
177 This simple text client uses the REST interface to connect to the Kea
178 Control Agent.
179 endef
180
181 ###### *************************************************************************
182 define Package/kea-uci
183 $(call Package/kea/Default)
184 TITLE+=UCI support
185 DEPENDS:=@(PACKAGE_kea-ctrl||PACKAGE_kea-dhcp4||PACKAGE_kea-dhcp6||PACKAGE_kea-dhcp-ddns)
186 endef
187 define Package/kea-uci/description
188 Kea PROCD/UCI support. This package installs a UCI config file and
189 a PROCD service file.
190 endef
191
192 ###### *************************************************************************
193
194 CONFIGURE_ARGS += \
195 --with-boost-include="$(STAGING_DIR)/usr" \
196 --with-log4cplus="$(STAGING_DIR)/usr" \
197 --with-openssl="$(STAGING_DIR)/usr" \
198 --without-pic \
199 $(if $(CONFIG_PACKAGE_kea-perfdhcp),--enable-perfdhcp,) \
200 $(if $(CONFIG_PACKAGE_kea-shell),--enable-shell,)
201
202 CONFIGURE_VARS += \
203 cross_compiling="yes"
204
205 TARGET_CXXFLAGS += \
206 $(FPIC) \
207 -fdata-sections \
208 -ffunction-sections \
209 -std=c++17
210
211 TARGET_LDFLAGS += \
212 -Wl,--gc-sections,--as-needed
213
214 define Package/kea-libs/install
215 $(INSTALL_DIR) $(1)/usr/lib
216 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
217 endef
218
219 define Package/kea-dhcp4/install
220 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
221 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp4 $(1)/usr/sbin/kea-dhcp4
222 $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp4.conf $(1)/etc/kea/
223 endef
224
225 define Package/kea-dhcp6/install
226 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
227 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp6 $(1)/usr/sbin/kea-dhcp6
228 $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp6.conf $(1)/etc/kea/
229 endef
230
231 define Package/kea-dhcp-ddns/install
232 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
233 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp-ddns $(1)/usr/sbin/kea-dhcp-ddns
234 $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp-ddns.conf $(1)/etc/kea/
235 endef
236
237 define Package/kea-admin/install
238 $(INSTALL_DIR) $(1)/usr/sbin
239 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
240 endef
241
242 define Package/kea-hook-ha/install
243 $(INSTALL_DIR) $(1)/usr/lib/kea/hooks
244 $(CP) $(PKG_INSTALL_DIR)/usr/lib/kea/hooks/libdhcp_ha.so $(1)/usr/lib/kea/hooks
245 endef
246
247 define Package/kea-hook-lease-cmds/install
248 $(INSTALL_DIR) $(1)/usr/lib/kea/hooks
249 $(CP) $(PKG_INSTALL_DIR)/usr/lib/kea/hooks/libdhcp_lease_cmds.so $(1)/usr/lib/kea/hooks
250 endef
251
252 define Package/kea-ctrl/install
253 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
254 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keactrl $(1)/usr/sbin/keactrl
255 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-ctrl-agent $(1)/usr/sbin/kea-ctrl-agent
256 $(CP) $(PKG_INSTALL_DIR)/etc/kea/keactrl.conf $(1)/etc/kea/
257 $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-ctrl-agent.conf $(1)/etc/kea/
258 endef
259
260 define Package/kea-lfc/install
261 $(INSTALL_DIR) $(1)/usr/sbin
262 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-lfc $(1)/usr/sbin/kea-lfc
263 endef
264
265 define Package/kea-perfdhcp/install
266 $(INSTALL_DIR) $(1)/usr/sbin
267 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/perfdhcp $(1)/usr/sbin/perfdhcp
268 endef
269
270 define Package/kea-shell/install
271 $(INSTALL_DIR) $(1)/usr/sbin
272 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-shell $(1)/usr/sbin/kea-shell
273 endef
274
275 define Package/kea-uci/install
276 $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
277 $(INSTALL_CONF) ./files/kea.config $(1)/etc/config/kea
278 $(INSTALL_BIN) ./files/kea.init $(1)/etc/init.d/kea
279 endef
280
281 define Package/kea-uci/conffiles
282 /etc/config/kea
283 endef
284
285 $(eval $(call HostBuild))
286 $(eval $(call BuildPackage,kea-libs))
287 $(eval $(call BuildPackage,kea-ctrl))
288 $(eval $(call BuildPackage,kea-dhcp4))
289 $(eval $(call BuildPackage,kea-dhcp6))
290 $(eval $(call BuildPackage,kea-dhcp-ddns))
291 $(eval $(call BuildPackage,kea-admin))
292 $(eval $(call BuildPackage,kea-hook-ha))
293 $(eval $(call BuildPackage,kea-hook-lease-cmds))
294 $(eval $(call BuildPackage,kea-lfc))
295 $(eval $(call BuildPackage,kea-perfdhcp))
296 $(eval $(call BuildPackage,kea-shell))
297 $(eval $(call BuildPackage,kea-uci))