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.

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