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.

270 lines
8.3 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.0
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://ftp.isc.org/isc/kea/$(PKG_VERSION)
  14. PKG_HASH:=3d91106fba3698194fb80da4149af709c7b2e89881311522816e561fca0ec0ea
  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. ###### *************************************************************************
  34. define Package/kea
  35. $(call Package/kea/Default)
  36. TITLE+=ISC Kea
  37. endef
  38. # shown in LuCI package description
  39. define Package/kea/description
  40. Kea is an open source DHCPv4/DHCPv6 server being developed by Internet
  41. Systems Consortium. Kea is a high-performance, extensible DHCP server
  42. engine that is designed to be easily modified and extended with hooks
  43. libraries. It provides DHCPv4 and DHCPv6 servers, a dynamic DNS update
  44. module, a portable DHCP library, libdhcp++, control agent that provides
  45. management REST interface, and a DHCP benchmarking tool, perfdhcp.
  46. endef
  47. ###### *************************************************************************
  48. define Package/kea-libs
  49. $(call Package/kea/Default)
  50. TITLE+=Libraries
  51. DEPENDS:=+libopenssl +log4cplus \
  52. +boost +boost-system
  53. endef
  54. define Package/kea-libs/description
  55. Kea required Libraries.
  56. endef
  57. ###### *************************************************************************
  58. define Package/kea-ctrl
  59. $(call Package/kea/Default)
  60. TITLE+=Control
  61. DEPENDS:=+procps-ng +procps-ng-ps +kea-dhcp4 \
  62. +IPV6:kea-dhcp6 +kea-dhcp-ddns
  63. endef
  64. define Package/kea-ctrl/description
  65. Tool to start, stop, reconfigure, and report status for the Kea servers.
  66. endef
  67. ###### *************************************************************************
  68. define Package/kea-dhcp4
  69. $(call Package/kea/Default)
  70. TITLE+=DHCP Server v4
  71. DEPENDS:=+kea-libs
  72. endef
  73. define Package/kea-dhcp4/description
  74. The DHCPv4 server process. This process responds to DHCPv4 queries from clients.
  75. endef
  76. ###### *************************************************************************
  77. define Package/kea-dhcp6
  78. $(call Package/kea/Default)
  79. TITLE+=DHCP Server v6
  80. DEPENDS:=@IPV6 +kea-libs
  81. endef
  82. define Package/kea-dhcp6/description
  83. The DHCPv6 server process. This process responds to DHCPv6 queries from clients.
  84. endef
  85. ###### *************************************************************************
  86. define Package/kea-dhcp-ddns
  87. $(call Package/kea/Default)
  88. TITLE+=DHCP Dynamic DNS
  89. DEPENDS:=+kea-libs
  90. endef
  91. define Package/kea-dhcp-ddns/description
  92. The DHCP Dynamic DNS process. This process acts as an intermediary between
  93. the DHCP servers and DNS servers. It receives name update requests from the
  94. DHCP servers and sends DNS Update messages to the DNS servers.
  95. endef
  96. ###### *************************************************************************
  97. define Package/kea-admin
  98. $(call Package/kea/Default)
  99. TITLE+=Admin
  100. DEPENDS:=+kea-libs
  101. endef
  102. define Package/kea-admin/description
  103. A useful tool for database backend maintenance (creating a new database,
  104. checking versions, upgrading etc.).
  105. endef
  106. ##### *************************************************************************
  107. define Package/kea-lfc
  108. $(call Package/kea/Default)
  109. TITLE+=lfc
  110. DEPENDS:=+kea-libs
  111. endef
  112. define Package/kea-lfc/description
  113. This process removes redundant information from the files used to provide
  114. persistent storage for the memfile data base backend. While it can be run
  115. standalone, it is normally run as and when required by the Kea DHCP servers.
  116. endef
  117. ##### *************************************************************************
  118. define Package/kea-perfdhcp
  119. $(call Package/kea/Default)
  120. TITLE+=perfdhcp (Benchmarking)
  121. DEPENDS:=+kea-libs
  122. endef
  123. define Package/kea-perfdhcp/description
  124. A DHCP benchmarking tool which simulates multiple clients to test both
  125. DHCPv4 and DHCPv6 server performance.
  126. endef
  127. ###### *************************************************************************
  128. define Package/kea-shell
  129. $(call Package/kea/Default)
  130. TITLE+=shell
  131. DEPENDS:=+kea-libs
  132. endef
  133. define Package/kea-shell/description
  134. This simple text client uses the REST interface to connect to the Kea
  135. Control Agent.
  136. endef
  137. ###### *************************************************************************
  138. HOST_CONFIGURE_ARGS += \
  139. --with-boost-include="$(STAGING_DIR_HOSTPKG)" \
  140. --with-log4cplus="$(STAGING_DIR_HOSTPKG)" \
  141. --with-openssl="$(STAGING_DIR_HOST)" \
  142. --enable-generate-messages
  143. HOST_LDFLAGS += \
  144. -Wl,--gc-sections,--as-needed
  145. CONFIGURE_ARGS += \
  146. --with-boost-include="$(STAGING_DIR)/usr" \
  147. --with-log4cplus="$(STAGING_DIR)/usr" \
  148. --with-openssl="$(STAGING_DIR)/usr" \
  149. --without-pic \
  150. $(if $(CONFIG_PACKAGE_kea-perfdhcp),--enable-perfdhcp,) \
  151. $(if $(CONFIG_PACKAGE_kea-shell),--enable-shell,)
  152. CONFIGURE_VARS += \
  153. cross_compiling="yes"
  154. TARGET_CXXFLAGS += \
  155. $(FPIC) \
  156. -fdata-sections \
  157. -ffunction-sections \
  158. -std=c++17
  159. TARGET_LDFLAGS += \
  160. -Wl,--gc-sections,--as-needed
  161. # Only compile the kea-msg-compiler which we need for
  162. # package compilation
  163. define Host/Compile
  164. +$(HOST_MAKE_VARS) \
  165. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/exceptions $(HOST_MAKE_FLAGS)
  166. +$(HOST_MAKE_VARS) \
  167. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/util $(HOST_MAKE_FLAGS)
  168. +$(HOST_MAKE_VARS) \
  169. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/log $(HOST_MAKE_FLAGS)
  170. endef
  171. define Host/Install
  172. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/lib/log/compiler/kea-msg-compiler \
  173. $(STAGING_DIR_HOSTPKG)/bin/
  174. endef
  175. define Build/Compile
  176. $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/lib/log/compiler
  177. $(INSTALL_BIN) $(STAGING_DIR_HOSTPKG)/bin/kea-msg-compiler \
  178. $(PKG_BUILD_DIR)/src/lib/log/compiler/
  179. $(call Build/Compile/Default)
  180. endef
  181. define Package/kea-libs/install
  182. $(INSTALL_DIR) $(1)/usr/lib
  183. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
  184. endef
  185. define Package/kea-dhcp4/install
  186. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  187. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp4 $(1)/usr/sbin/kea-dhcp4
  188. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp4.conf $(1)/etc/kea/
  189. endef
  190. define Package/kea-dhcp6/install
  191. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp6 $(1)/usr/sbin/kea-dhcp6
  193. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp6.conf $(1)/etc/kea/
  194. endef
  195. define Package/kea-dhcp-ddns/install
  196. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  197. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp-ddns $(1)/usr/sbin/kea-dhcp-ddns
  198. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp-ddns.conf $(1)/etc/kea/
  199. endef
  200. define Package/kea-admin/install
  201. $(INSTALL_DIR) $(1)/usr/sbin
  202. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
  203. endef
  204. define Package/kea-ctrl/install
  205. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  206. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keactrl $(1)/usr/sbin/keactrl
  207. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-ctrl-agent $(1)/usr/sbin/kea-ctrl-agent
  208. $(CP) $(PKG_INSTALL_DIR)/etc/kea/keactrl.conf $(1)/etc/kea/
  209. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-ctrl-agent.conf $(1)/etc/kea/
  210. endef
  211. define Package/kea-lfc/install
  212. $(INSTALL_DIR) $(1)/usr/sbin
  213. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-lfc $(1)/usr/sbin/kea-lfc
  214. endef
  215. define Package/kea-perfdhcp/install
  216. $(INSTALL_DIR) $(1)/usr/sbin
  217. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/perfdhcp $(1)/usr/sbin/perfdhcp
  218. endef
  219. define Package/kea-shell/install
  220. $(INSTALL_DIR) $(1)/usr/sbin
  221. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-shell $(1)/usr/sbin/kea-shell
  222. endef
  223. $(eval $(call HostBuild))
  224. $(eval $(call BuildPackage,kea-libs))
  225. $(eval $(call BuildPackage,kea-ctrl))
  226. $(eval $(call BuildPackage,kea-dhcp4))
  227. $(eval $(call BuildPackage,kea-dhcp6))
  228. $(eval $(call BuildPackage,kea-dhcp-ddns))
  229. $(eval $(call BuildPackage,kea-admin))
  230. $(eval $(call BuildPackage,kea-lfc))
  231. $(eval $(call BuildPackage,kea-perfdhcp))
  232. $(eval $(call BuildPackage,kea-shell))