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.

204 lines
5.6 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:=2
  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. --without-pic
  94. HOST_LDFLAGS += \
  95. -Wl,--gc-sections,--as-needed
  96. TARGET_CXXFLAGS += \
  97. $(FPIC) \
  98. -fdata-sections \
  99. -ffunction-sections
  100. TARGET_LDFLAGS += \
  101. -Wl,--gc-sections,--as-needed
  102. # Only compile the kea-msg-compiler which we need for
  103. # package compilation
  104. define Host/Compile
  105. +$(HOST_MAKE_VARS) \
  106. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/exceptions $(HOST_MAKE_FLAGS)
  107. +$(HOST_MAKE_VARS) \
  108. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/util $(HOST_MAKE_FLAGS)
  109. +$(HOST_MAKE_VARS) \
  110. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/src/lib/log $(HOST_MAKE_FLAGS)
  111. endef
  112. define Host/Install
  113. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/lib/log/compiler/kea-msg-compiler \
  114. $(STAGING_DIR_HOSTPKG)/bin/
  115. endef
  116. define Build/Compile
  117. $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/lib/log/compiler
  118. $(INSTALL_BIN) $(STAGING_DIR_HOSTPKG)/bin/kea-msg-compiler \
  119. $(PKG_BUILD_DIR)/src/lib/log/compiler/
  120. $(call Build/Compile/Default)
  121. endef
  122. define Package/kea-libs/install
  123. $(INSTALL_DIR) $(1)/usr/lib
  124. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  125. endef
  126. define Package/kea-dhcp4/install
  127. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  128. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp4 $(1)/usr/sbin/kea-dhcp4
  129. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp4.conf $(1)/etc/kea/
  130. endef
  131. define Package/kea-dhcp6/install
  132. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  133. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp6 $(1)/usr/sbin/kea-dhcp6
  134. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp6.conf $(1)/etc/kea/
  135. endef
  136. define Package/kea-dhcp-ddns/install
  137. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  138. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-dhcp-ddns $(1)/usr/sbin/kea-dhcp-ddns
  139. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-dhcp-ddns.conf $(1)/etc/kea/
  140. endef
  141. define Package/kea-admin/install
  142. $(INSTALL_DIR) $(1)/usr/sbin
  143. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-admin $(1)/usr/sbin/kea-admin
  144. endef
  145. define Package/kea-ctrl/install
  146. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/kea
  147. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keactrl $(1)/usr/sbin/keactrl
  148. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-ctrl-agent $(1)/usr/sbin/kea-ctrl-agent
  149. $(CP) $(PKG_INSTALL_DIR)/etc/kea/keactrl.conf $(1)/etc/kea/
  150. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-ctrl-agent.conf $(1)/etc/kea/
  151. $(CP) $(PKG_INSTALL_DIR)/etc/kea/kea-netconf.conf $(1)/etc/kea/
  152. endef
  153. define Package/kea-lfc/install
  154. $(INSTALL_DIR) $(1)/usr/sbin
  155. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kea-lfc $(1)/usr/sbin/kea-lfc
  156. endef
  157. define Package/kea-perfdhcp/install
  158. $(INSTALL_DIR) $(1)/usr/sbin
  159. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/perfdhcp $(1)/usr/sbin/perfdhcp
  160. endef
  161. $(eval $(call HostBuild))
  162. $(eval $(call BuildPackage,kea-libs))
  163. $(eval $(call BuildPackage,kea-dhcp4))
  164. $(eval $(call BuildPackage,kea-dhcp6))
  165. $(eval $(call BuildPackage,kea-dhcp-ddns))
  166. $(eval $(call BuildPackage,kea-admin))
  167. $(eval $(call BuildPackage,kea-ctrl))
  168. $(eval $(call BuildPackage,kea-lfc))
  169. $(eval $(call BuildPackage,kea-perfdhcp))