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.

207 lines
5.7 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.5.0
  11. PKG_RELEASE:=5
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://ftp.isc.org/isc/kea/$(PKG_VERSION)
  14. PKG_HASH:=edce4fab68ca7af607cf7f5bc86596e04fe0ef4b8e88906e339cdefcf21daaec
  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. define Package/kea/description
  34. Kea is an open source DHCPv4/DHCPv6 server being developed by Internet
  35. Systems Consortium. Kea is a high-performance, extensible DHCP server
  36. engine that is designed to be easily modified and extended with hooks
  37. libraries. It provides DHCPv4 and DHCPv6 servers, a dynamic DNS update
  38. module, a portable DHCP library, libdhcp++, control agent that provides
  39. management REST interface, and a DHCP benchmarking tool, perfdhcp.
  40. endef
  41. define Package/kea-libs
  42. $(call Package/kea/Default)
  43. TITLE+= Libraries
  44. DEPENDS:=+libopenssl +log4cplus \
  45. +boost +boost-python3 +boost-system
  46. endef
  47. define Package/kea-dhcp4
  48. $(call Package/kea/Default)
  49. TITLE+= DHCP Server v4
  50. DEPENDS:=+kea-libs
  51. endef
  52. define Package/kea-dhcp6
  53. $(call Package/kea/Default)
  54. TITLE+= DHCP Server v6
  55. DEPENDS:=@IPV6 +kea-libs
  56. endef
  57. define Package/kea-dhcp-ddns
  58. $(call Package/kea/Default)
  59. TITLE+= DHCP - DDNS
  60. DEPENDS:=+kea-libs
  61. endef
  62. define Package/kea-admin
  63. $(call Package/kea/Default)
  64. TITLE+= Admin
  65. DEPENDS:= +kea-libs +python3
  66. endef
  67. define Package/kea-ctrl
  68. $(call Package/kea/Default)
  69. TITLE+= Control
  70. DEPENDS:= +kea-dhcp4 +IPV6:kea-dhcp6 \
  71. +kea-dhcp-ddns
  72. endef
  73. define Package/kea-lfc
  74. $(call Package/kea/Default)
  75. TITLE+= lfc
  76. DEPENDS:=+kea-libs
  77. endef
  78. define Package/kea-perfdhcp
  79. $(call Package/kea/Default)
  80. TITLE+= perfdhcp
  81. DEPENDS:=+kea-libs
  82. endef
  83. HOST_CONFIGURE_ARGS += \
  84. --with-boost-include="$(STAGING_DIR_HOSTPKG)" \
  85. --with-log4cplus="$(STAGING_DIR_HOSTPKG)" \
  86. --with-openssl="$(STAGING_DIR)/usr" \
  87. --enable-boost-headers-only \
  88. --enable-static-link
  89. HOST_LDFLAGS += \
  90. -Wl,--gc-sections,--as-needed
  91. CONFIGURE_ARGS += \
  92. --with-boost-include="$(STAGING_DIR)/usr" \
  93. --with-log4cplus="$(STAGING_DIR)/usr" \
  94. --with-openssl="$(STAGING_DIR)/usr" \
  95. --without-pic \
  96. $(if $(CONFIG_PACKAGE_kea-perfdhcp),--enable-perfdhcp,)
  97. CONFIGURE_VARS += \
  98. cross_compiling="yes"
  99. TARGET_CXXFLAGS += \
  100. $(FPIC) \
  101. -fdata-sections \
  102. -ffunction-sections
  103. TARGET_LDFLAGS += \
  104. -Wl,--gc-sections,--as-needed
  105. # Only compile the kea-msg-compiler which we need for
  106. # package compilation
  107. define Host/Compile
  108. +$(HOST_MAKE_VARS) \
  109. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/exceptions $(HOST_MAKE_FLAGS)
  110. +$(HOST_MAKE_VARS) \
  111. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/util $(HOST_MAKE_FLAGS)
  112. +$(HOST_MAKE_VARS) \
  113. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/log $(HOST_MAKE_FLAGS)
  114. endef
  115. define Host/Install
  116. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/lib/log/compiler/kea-msg-compiler \
  117. $(STAGING_DIR_HOSTPKG)/bin/
  118. endef
  119. define Build/Compile
  120. $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/lib/log/compiler
  121. $(INSTALL_BIN) $(STAGING_DIR_HOSTPKG)/bin/kea-msg-compiler \
  122. $(PKG_BUILD_DIR)/src/lib/log/compiler/
  123. $(call Build/Compile/Default)
  124. endef
  125. define Package/kea-libs/install
  126. $(INSTALL_DIR) $(1)/usr/lib
  127. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  128. endef
  129. define Package/kea-dhcp4/install
  130. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  131. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp4 $(1)/usr/sbin/kea-dhcp4
  132. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp4.conf $(1)/etc/kea/
  133. endef
  134. define Package/kea-dhcp6/install
  135. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  136. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp6 $(1)/usr/sbin/kea-dhcp6
  137. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp6.conf $(1)/etc/kea/
  138. endef
  139. define Package/kea-dhcp-ddns/install
  140. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  141. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp-ddns $(1)/usr/sbin/kea-dhcp-ddns
  142. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp-ddns.conf $(1)/etc/kea/
  143. endef
  144. define Package/kea-admin/install
  145. $(INSTALL_DIR) $(1)/usr/sbin
  146. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
  147. endef
  148. define Package/kea-ctrl/install
  149. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  150. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keactrl $(1)/usr/sbin/keactrl
  151. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-ctrl-agent $(1)/usr/sbin/kea-ctrl-agent
  152. $(CP) $(PKG_INSTALL_DIR)/etc/kea/keactrl.conf $(1)/etc/kea/
  153. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-ctrl-agent.conf $(1)/etc/kea/
  154. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-netconf.conf $(1)/etc/kea/
  155. endef
  156. define Package/kea-lfc/install
  157. $(INSTALL_DIR) $(1)/usr/sbin
  158. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-lfc $(1)/usr/sbin/kea-lfc
  159. endef
  160. define Package/kea-perfdhcp/install
  161. $(INSTALL_DIR) $(1)/usr/sbin
  162. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/perfdhcp $(1)/usr/sbin/perfdhcp
  163. endef
  164. $(eval $(call HostBuild))
  165. $(eval $(call BuildPackage,kea-libs))
  166. $(eval $(call BuildPackage,kea-dhcp4))
  167. $(eval $(call BuildPackage,kea-dhcp6))
  168. $(eval $(call BuildPackage,kea-dhcp-ddns))
  169. $(eval $(call BuildPackage,kea-admin))
  170. $(eval $(call BuildPackage,kea-ctrl))
  171. $(eval $(call BuildPackage,kea-lfc))
  172. $(eval $(call BuildPackage,kea-perfdhcp))