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.

251 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.1
  11. PKG_RELEASE:=4
  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:=2a22508922ab367b4af4664a0472dc220cc9603482cf3c16d9aff14f3a76b608
  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. --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/dhcrelay.conf $(1)/etc/config/dhcrelay
  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))