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.

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