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