You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

332 lines
10 KiB

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