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.

269 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:=1
  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. TARGET_LDFLAGS += \
  159. -Wl,--gc-sections,--as-needed
  160. # Only compile the kea-msg-compiler which we need for
  161. # package compilation
  162. define Host/Compile
  163. +$(HOST_MAKE_VARS) \
  164. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/exceptions $(HOST_MAKE_FLAGS)
  165. +$(HOST_MAKE_VARS) \
  166. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/util $(HOST_MAKE_FLAGS)
  167. +$(HOST_MAKE_VARS) \
  168. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/log $(HOST_MAKE_FLAGS)
  169. endef
  170. define Host/Install
  171. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/lib/log/compiler/kea-msg-compiler \
  172. $(STAGING_DIR_HOSTPKG)/bin/
  173. endef
  174. define Build/Compile
  175. $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/lib/log/compiler
  176. $(INSTALL_BIN) $(STAGING_DIR_HOSTPKG)/bin/kea-msg-compiler \
  177. $(PKG_BUILD_DIR)/src/lib/log/compiler/
  178. $(call Build/Compile/Default)
  179. endef
  180. define Package/kea-libs/install
  181. $(INSTALL_DIR) $(1)/usr/lib
  182. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
  183. endef
  184. define Package/kea-dhcp4/install
  185. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  186. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp4 $(1)/usr/sbin/kea-dhcp4
  187. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp4.conf $(1)/etc/kea/
  188. endef
  189. define Package/kea-dhcp6/install
  190. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  191. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp6 $(1)/usr/sbin/kea-dhcp6
  192. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp6.conf $(1)/etc/kea/
  193. endef
  194. define Package/kea-dhcp-ddns/install
  195. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  196. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp-ddns $(1)/usr/sbin/kea-dhcp-ddns
  197. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp-ddns.conf $(1)/etc/kea/
  198. endef
  199. define Package/kea-admin/install
  200. $(INSTALL_DIR) $(1)/usr/sbin
  201. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
  202. endef
  203. define Package/kea-ctrl/install
  204. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  205. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keactrl $(1)/usr/sbin/keactrl
  206. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-ctrl-agent $(1)/usr/sbin/kea-ctrl-agent
  207. $(CP) $(PKG_INSTALL_DIR)/etc/kea/keactrl.conf $(1)/etc/kea/
  208. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-ctrl-agent.conf $(1)/etc/kea/
  209. endef
  210. define Package/kea-lfc/install
  211. $(INSTALL_DIR) $(1)/usr/sbin
  212. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-lfc $(1)/usr/sbin/kea-lfc
  213. endef
  214. define Package/kea-perfdhcp/install
  215. $(INSTALL_DIR) $(1)/usr/sbin
  216. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/perfdhcp $(1)/usr/sbin/perfdhcp
  217. endef
  218. define Package/kea-shell/install
  219. $(INSTALL_DIR) $(1)/usr/sbin
  220. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-shell $(1)/usr/sbin/kea-shell
  221. endef
  222. $(eval $(call HostBuild))
  223. $(eval $(call BuildPackage,kea-libs))
  224. $(eval $(call BuildPackage,kea-ctrl))
  225. $(eval $(call BuildPackage,kea-dhcp4))
  226. $(eval $(call BuildPackage,kea-dhcp6))
  227. $(eval $(call BuildPackage,kea-dhcp-ddns))
  228. $(eval $(call BuildPackage,kea-admin))
  229. $(eval $(call BuildPackage,kea-lfc))
  230. $(eval $(call BuildPackage,kea-perfdhcp))
  231. $(eval $(call BuildPackage,kea-shell))