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.

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