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.

249 lines
6.8 KiB

  1. #
  2. # Copyright (C) 2006-2012 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=isc-dhcp
  9. UPSTREAM_NAME:=dhcp
  10. PKG_VERSION:=4.3.6
  11. PKG_RELEASE:=1
  12. PKG_LICENSE:=BSD-3-Clause
  13. PKG_LICENSE_FILES:=LICENSE
  14. PKG_MAINTAINER:=Philip Prindeville <philipp@redfish-solutions.com>
  15. PKG_SOURCE:=$(UPSTREAM_NAME)-$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION) \
  17. http://ftp.funet.fi/pub/mirrors/ftp.isc.org/isc/dhcp/$(PKG_VERSION) \
  18. http://ftp.iij.ad.jp/pub/network/isc/dhcp/$(PKG_VERSION)
  19. PKG_HASH:=a41eaf6364f1377fe065d35671d9cf82bbbc8f21207819b2b9f33f652aec6f1b
  20. PKG_FIXUP:=autoreconf
  21. PKG_BUILD_PARALLEL:=1
  22. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(UPSTREAM_NAME)-$(PKG_VERSION)
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/isc-dhcp/Default
  25. SECTION:=net
  26. CATEGORY:=Network
  27. SUBMENU:=IP Addresses and Names
  28. TITLE:=ISC's DHCP
  29. URL:=https://www.isc.org/software/dhcp
  30. endef
  31. define Package/isc-dhcp-relay-ipv4
  32. $(call Package/isc-dhcp/Default)
  33. TITLE+= relay (without IPv6)
  34. VARIANT:=ipv4
  35. endef
  36. define Package/isc-dhcp-relay-ipv6
  37. $(call Package/isc-dhcp/Default)
  38. TITLE+= relay (with IPv6)
  39. VARIANT:=ipv6
  40. endef
  41. define Package/isc-dhcp-relay/description
  42. provides a means for relaying DHCP and BOOTP requests from a subnet to which
  43. no DHCP server is directly connected to one or more DHCP servers on other
  44. subnets.
  45. endef
  46. define Package/isc-dhcp-relay-ipv4/description
  47. $(call Package/isc-dhcp-relay-ipv6/description)
  48. This package is compiled with IPv4 support only.
  49. endef
  50. define Package/isc-dhcp-relay-ipv4/conffiles
  51. /etc/config/dhcrelay
  52. endef
  53. define Package/isc-dhcp-relay-ipv6/description
  54. $(call Package/isc-dhcp-relay/description)
  55. This package is compiled with IPv4 and IPv6 support.
  56. endef
  57. define Package/isc-dhcp-relay-ipv6/conffiles
  58. /etc/config/dhcrelay
  59. endef
  60. define Package/isc-dhcp-client-ipv4
  61. $(call Package/isc-dhcp/Default)
  62. TITLE+= client (without IPv6)
  63. VARIANT:=ipv4
  64. endef
  65. define Package/isc-dhcp-client-ipv6
  66. $(call Package/isc-dhcp/Default)
  67. TITLE+= client (with IPv6)
  68. VARIANT:=ipv6
  69. endef
  70. define Package/isc-dhcp-client/description
  71. provides a means for configuring one or more network interfaces using the
  72. Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols
  73. fail, by statically assigning an address.
  74. endef
  75. define Package/isc-dhcp-client-ipv4/description
  76. $(call Package/isc-dhcp-client/description)
  77. This package is compiled with IPv4 support only.
  78. endef
  79. define Package/isc-dhcp-client-ipv6/description
  80. $(call Package/isc-dhcp-client/description)
  81. This package is compiled with IPv4 and IPv6 support.
  82. endef
  83. define Package/isc-dhcp-server-ipv4
  84. $(call Package/isc-dhcp/Default)
  85. TITLE+= server (without IPv6)
  86. VARIANT:=ipv4
  87. endef
  88. define Package/isc-dhcp-server-ipv6
  89. $(call Package/isc-dhcp/Default)
  90. TITLE+= server (with IPv6)
  91. VARIANT:=ipv6
  92. endef
  93. define Package/isc-dhcp-server/description
  94. implements the Dynamic Host Configuration Protocol (DHCP) and the Internet
  95. Bootstrap Protocol (BOOTP).
  96. endef
  97. define Package/isc-dhcp-server-ipv4/description
  98. $(call Package/isc-dhcp-server/description)
  99. This package is compiled with IPv4 support only.
  100. endef
  101. define Package/isc-dhcp-server-ipv6/description
  102. $(call Package/isc-dhcp-server/description)
  103. This package is compiled with IPv4 and IPv6 support.
  104. endef
  105. define Package/isc-dhcp-omshell-ipv4
  106. $(call Package/isc-dhcp/Default)
  107. DEPENDS:= +isc-dhcp-server-ipv4
  108. TITLE+= omshell (without IPv6)
  109. VARIANT:=ipv4
  110. endef
  111. define Package/isc-dhcp-omshell-ipv6
  112. $(call Package/isc-dhcp/Default)
  113. DEPENDS:= +isc-dhcp-server-ipv6
  114. TITLE+= omshell (with IPv6)
  115. VARIANT:=ipv6
  116. endef
  117. define Package/isc-dhcp-omshell/description
  118. provides an interactive way to connect to, query, and possibly change, the ISC
  119. DHCP Server's state via OMAPI, the Object Management API.
  120. endef
  121. define Package/isc-dhcp-omshell-ipv4/description
  122. $(call Package/isc-dhcp-omshell/description)
  123. This package is compiled with IPv4 support only.
  124. endef
  125. define Package/isc-dhcp-omshell-ipv6/description
  126. $(call Package/isc-dhcp-omshell/description)
  127. This package is compiled with IPv4 and IPv6 support.
  128. endef
  129. CONFIGURE_ARGS += \
  130. --disable-tracing \
  131. --enable-paranoia \
  132. --disable-dependency-tracking \
  133. --with-randomdev=/dev/urandom \
  134. ac_cv_file__dev_random=yes
  135. ifeq ($(BUILD_VARIANT),ipv4)
  136. CONFIGURE_ARGS += --disable-dhcpv6
  137. endif
  138. ifeq ($(BUILD_VARIANT),ipv6)
  139. CONFIGURE_ARGS += --enable-dhcpv6
  140. endif
  141. define Build/Compile
  142. $(MAKE) -C $(PKG_BUILD_DIR) \
  143. BUILD_CC="$(HOSTCC_NOCACHE)" \
  144. CROSS_CC="$(TARGET_CC)" \
  145. host_alias="$(GNU_TARGET_NAME)" \
  146. target_alias="$(GNU_TARGET_NAME)" \
  147. build_alias="$(GNU_HOST_NAME)" \
  148. all
  149. $(MAKE) -C $(PKG_BUILD_DIR) \
  150. DESTDIR="$(PKG_INSTALL_DIR)" \
  151. BUILD_CC="$(HOSTCC_NOCACHE)" \
  152. CROSS_CC="$(TARGET_CC)" \
  153. host_alias="$(GNU_TARGET_NAME)" \
  154. target_alias="$(GNU_TARGET_NAME)" \
  155. build_alias="$(GNU_HOST_NAME)" \
  156. install-exec
  157. endef
  158. define Package/isc-dhcp-relay-$(BUILD_VARIANT)/install
  159. $(INSTALL_DIR) $(1)/usr/sbin
  160. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcrelay $(1)/usr/sbin
  161. $(INSTALL_DIR) $(1)/etc/config
  162. $(INSTALL_DATA) ./files/etc/config/dhcrelay $(1)/etc/config
  163. $(INSTALL_DIR) $(1)/etc/init.d
  164. $(INSTALL_BIN) ./files/dhcrelay4.init $(1)/etc/init.d/dhcrelay4
  165. endef
  166. define Package/isc-dhcp-server-$(BUILD_VARIANT)/install
  167. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/uci-defaults
  168. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcpd $(1)/usr/sbin
  169. $(INSTALL_BIN) ./files/dhcpd.init $(1)/etc/init.d/dhcpd
  170. $(INSTALL_BIN) ./files/dhcpd.defaults $(1)/etc/uci-defaults
  171. ifeq ($(BUILD_VARIANT),ipv6)
  172. $(INSTALL_BIN) ./files/dhcpd6.init $(1)/etc/init.d/dhcpd6
  173. $(INSTALL_BIN) ./files/dhcpd6.conf $(1)/etc
  174. endif
  175. endef
  176. define Package/isc-dhcp-server-ipv4/conffiles
  177. /etc/dhcpd.conf
  178. endef
  179. define Package/isc-dhcp-server-ipv6/conffiles
  180. /etc/dhcpd6.conf
  181. endef
  182. define Package/isc-dhcp-client-$(BUILD_VARIANT)/install
  183. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc
  184. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhclient $(1)/usr/sbin
  185. $(INSTALL_BIN) ./files/dhclient-script $(1)/usr/sbin/
  186. ifeq ($(BUILD_VARIANT),ipv6)
  187. $(INSTALL_BIN) ./files/dhclient6.conf $(1)/etc
  188. endif
  189. endef
  190. define Package/isc-dhcp-client-ipv4/conffiles
  191. /etc/dhclient.conf
  192. endef
  193. define Package/isc-dhcp-client-ipv6/conffiles
  194. /etc/dhclient6.conf
  195. endef
  196. define Package/isc-dhcp-omshell-$(BUILD_VARIANT)/install
  197. $(INSTALL_DIR) $(1)/usr/bin
  198. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/omshell $(1)/usr/bin
  199. endef
  200. $(eval $(call BuildPackage,isc-dhcp-relay-ipv4))
  201. $(eval $(call BuildPackage,isc-dhcp-server-ipv4))
  202. $(eval $(call BuildPackage,isc-dhcp-client-ipv4))
  203. $(eval $(call BuildPackage,isc-dhcp-omshell-ipv4))
  204. $(eval $(call BuildPackage,isc-dhcp-relay-ipv6))
  205. $(eval $(call BuildPackage,isc-dhcp-server-ipv6))
  206. $(eval $(call BuildPackage,isc-dhcp-client-ipv6))
  207. $(eval $(call BuildPackage,isc-dhcp-omshell-ipv6))