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.

252 lines
7.8 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.6.2
  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:=2af7336027143c3e98d8d1d44165b2c2cbb0252a92bd88f6dd4d2c6adb69d7b5
  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. HOST_CONFIGURE_ARGS += \
  129. --with-boost-include="$(STAGING_DIR_HOSTPKG)" \
  130. --with-log4cplus="$(STAGING_DIR_HOSTPKG)" \
  131. --with-openssl="$(STAGING_DIR_HOST)" \
  132. --enable-boost-headers-only \
  133. --enable-generate-messages
  134. HOST_LDFLAGS += \
  135. -Wl,--gc-sections,--as-needed
  136. CONFIGURE_ARGS += \
  137. --with-boost-include="$(STAGING_DIR)/usr" \
  138. --with-log4cplus="$(STAGING_DIR)/usr" \
  139. --with-openssl="$(STAGING_DIR)/usr" \
  140. --without-pic \
  141. $(if $(CONFIG_PACKAGE_kea-perfdhcp),--enable-perfdhcp,)
  142. CONFIGURE_VARS += \
  143. cross_compiling="yes"
  144. TARGET_CXXFLAGS += \
  145. $(FPIC) \
  146. -fdata-sections \
  147. -ffunction-sections
  148. TARGET_LDFLAGS += \
  149. -Wl,--gc-sections,--as-needed
  150. # Only compile the kea-msg-compiler which we need for
  151. # package compilation
  152. define Host/Compile
  153. +$(HOST_MAKE_VARS) \
  154. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/exceptions $(HOST_MAKE_FLAGS)
  155. +$(HOST_MAKE_VARS) \
  156. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/util $(HOST_MAKE_FLAGS)
  157. +$(HOST_MAKE_VARS) \
  158. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/log $(HOST_MAKE_FLAGS)
  159. endef
  160. define Host/Install
  161. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/lib/log/compiler/kea-msg-compiler \
  162. $(STAGING_DIR_HOSTPKG)/bin/
  163. endef
  164. define Build/Compile
  165. $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/lib/log/compiler
  166. $(INSTALL_BIN) $(STAGING_DIR_HOSTPKG)/bin/kea-msg-compiler \
  167. $(PKG_BUILD_DIR)/src/lib/log/compiler/
  168. $(call Build/Compile/Default)
  169. endef
  170. define Package/kea-libs/install
  171. $(INSTALL_DIR) $(1)/usr/lib
  172. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
  173. endef
  174. define Package/kea-dhcp4/install
  175. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp4 $(1)/usr/sbin/kea-dhcp4
  177. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp4.conf $(1)/etc/kea/
  178. endef
  179. define Package/kea-dhcp6/install
  180. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  181. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp6 $(1)/usr/sbin/kea-dhcp6
  182. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp6.conf $(1)/etc/kea/
  183. endef
  184. define Package/kea-dhcp-ddns/install
  185. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  186. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp-ddns $(1)/usr/sbin/kea-dhcp-ddns
  187. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp-ddns.conf $(1)/etc/kea/
  188. endef
  189. define Package/kea-admin/install
  190. $(INSTALL_DIR) $(1)/usr/sbin
  191. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
  192. endef
  193. define Package/kea-ctrl/install
  194. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  195. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keactrl $(1)/usr/sbin/keactrl
  196. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-ctrl-agent $(1)/usr/sbin/kea-ctrl-agent
  197. $(CP) $(PKG_INSTALL_DIR)/etc/kea/keactrl.conf $(1)/etc/kea/
  198. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-ctrl-agent.conf $(1)/etc/kea/
  199. endef
  200. define Package/kea-lfc/install
  201. $(INSTALL_DIR) $(1)/usr/sbin
  202. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-lfc $(1)/usr/sbin/kea-lfc
  203. endef
  204. define Package/kea-perfdhcp/install
  205. $(INSTALL_DIR) $(1)/usr/sbin
  206. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/perfdhcp $(1)/usr/sbin/perfdhcp
  207. endef
  208. $(eval $(call HostBuild))
  209. $(eval $(call BuildPackage,kea-libs))
  210. $(eval $(call BuildPackage,kea-ctrl))
  211. $(eval $(call BuildPackage,kea-dhcp4))
  212. $(eval $(call BuildPackage,kea-dhcp6))
  213. $(eval $(call BuildPackage,kea-dhcp-ddns))
  214. $(eval $(call BuildPackage,kea-admin))
  215. $(eval $(call BuildPackage,kea-lfc))
  216. $(eval $(call BuildPackage,kea-perfdhcp))