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.

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