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.

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