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.

295 lines
8.1 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.3
  11. PKG_RELEASE:=$(AUTORELEASE)
  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:=0e3ec6b4c2a05ec0148874bcd999a66d05518378d77421f607fb0bc9d0135818
  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. endef
  91. define Package/isc-dhcp-server-ipv6
  92. $(call Package/isc-dhcp/Default)
  93. TITLE+= server (with IPv6)
  94. VARIANT:=ipv6
  95. endef
  96. define Package/isc-dhcp-server/description
  97. implements the Dynamic Host Configuration Protocol (DHCP) and the Internet
  98. Bootstrap Protocol (BOOTP).
  99. endef
  100. define Package/isc-dhcp-server-ipv4/description
  101. $(call Package/isc-dhcp-server/description)
  102. This package is compiled with IPv4 support only.
  103. endef
  104. define Package/isc-dhcp-server-ipv6/description
  105. $(call Package/isc-dhcp-server/description)
  106. This package is compiled with IPv4 and IPv6 support.
  107. endef
  108. define Package/isc-dhcp-dyndns-ipv4
  109. $(call Package/isc-dhcp/Default)
  110. TITLE+= server dynamic DNS dependencies (meta)
  111. DEPENDS+=isc-dhcp-server-ipv4 +bind-server +bind-client
  112. VARIANT:=ipv4
  113. endef
  114. define Package/isc-dhcp-dyndns-ipv6
  115. $(call Package/isc-dhcp/Default)
  116. TITLE+= server dynamic DNS dependencies (meta)
  117. DEPENDS+=isc-dhcp-server-ipv6 +bind-server +bind-client
  118. VARIANT:=ipv6
  119. endef
  120. define Package/isc-dhcp-dyndns/description
  121. implements the Dynamic Host Configuration Protocol (DHCP) and the Internet
  122. Bootstrap Protocol (BOOTP).
  123. endef
  124. define Package/isc-dhcp-dyndns-ipv4/description
  125. $(call Package/isc-dhcp-dyndns/description)
  126. This package is compiled with IPv4 support only.
  127. endef
  128. define Package/isc-dhcp-dyndns-ipv6/description
  129. $(call Package/isc-dhcp-dyndns/description)
  130. This package is compiled with IPv4 and IPv6 support.
  131. endef
  132. define Package/isc-dhcp-omshell-ipv4
  133. $(call Package/isc-dhcp/Default)
  134. DEPENDS:= +isc-dhcp-server-ipv4
  135. TITLE+= omshell (without IPv6)
  136. VARIANT:=ipv4
  137. endef
  138. define Package/isc-dhcp-omshell-ipv6
  139. $(call Package/isc-dhcp/Default)
  140. DEPENDS:= +isc-dhcp-server-ipv6
  141. TITLE+= omshell (with IPv6)
  142. VARIANT:=ipv6
  143. endef
  144. define Package/isc-dhcp-omshell/description
  145. provides an interactive way to connect to, query, and possibly change, the ISC
  146. DHCP Server's state via OMAPI, the Object Management API.
  147. endef
  148. define Package/isc-dhcp-omshell-ipv4/description
  149. $(call Package/isc-dhcp-omshell/description)
  150. This package is compiled with IPv4 support only.
  151. endef
  152. define Package/isc-dhcp-omshell-ipv6/description
  153. $(call Package/isc-dhcp-omshell/description)
  154. This package is compiled with IPv4 and IPv6 support.
  155. endef
  156. CONFIGURE_ARGS += \
  157. --enable-paranoia \
  158. --disable-dependency-tracking \
  159. --with-randomdev=/dev/urandom \
  160. --disable-backtrace \
  161. ac_cv_path_AR=$(TARGET_AR) \
  162. ac_cv_file__dev_random=yes
  163. ifeq ($(BUILD_VARIANT),ipv4)
  164. CONFIGURE_ARGS += --disable-dhcpv6
  165. endif
  166. ifeq ($(BUILD_VARIANT),ipv6)
  167. CONFIGURE_ARGS += --enable-dhcpv6
  168. endif
  169. TARGET_CFLAGS += -fcommon
  170. define Build/Compile
  171. $(MAKE) -C $(PKG_BUILD_DIR) \
  172. BUILD_CC="$(HOSTCC_NOCACHE)" \
  173. CROSS_CC="$(TARGET_CC)" \
  174. TARGET_AR="$(TARGET_AR)" \
  175. TARGET_RANLIB="$(TARGET_RANLIB)" \
  176. host_alias="$(GNU_TARGET_NAME)" \
  177. target_alias="$(GNU_TARGET_NAME)" \
  178. build_alias="$(GNU_HOST_NAME)" \
  179. all
  180. $(MAKE) -C $(PKG_BUILD_DIR) \
  181. DESTDIR="$(PKG_INSTALL_DIR)" \
  182. BUILD_CC="$(HOSTCC_NOCACHE)" \
  183. CROSS_CC="$(TARGET_CC)" \
  184. TARGET_AR="$(TARGET_AR)" \
  185. TARGET_RANLIB="$(TARGET_RANLIB)" \
  186. host_alias="$(GNU_TARGET_NAME)" \
  187. target_alias="$(GNU_TARGET_NAME)" \
  188. build_alias="$(GNU_HOST_NAME)" \
  189. install-exec
  190. endef
  191. define Package/isc-dhcp-relay-$(BUILD_VARIANT)/install
  192. $(INSTALL_DIR) $(1)/usr/sbin
  193. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcrelay $(1)/usr/sbin
  194. $(INSTALL_DIR) $(1)/etc/config
  195. $(INSTALL_DATA) ./files/dhcrelay.conf $(1)/etc/config/dhcrelay
  196. $(INSTALL_DIR) $(1)/etc/init.d
  197. $(INSTALL_BIN) ./files/dhcrelay4.init $(1)/etc/init.d/dhcrelay4
  198. endef
  199. define Package/isc-dhcp-server-$(BUILD_VARIANT)/install
  200. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/uci-defaults
  201. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcpd $(1)/usr/sbin
  202. $(INSTALL_BIN) ./files/dhcpd.init $(1)/etc/init.d/dhcpd
  203. $(INSTALL_BIN) ./files/dhcpd.defaults $(1)/etc/uci-defaults
  204. ifeq ($(BUILD_VARIANT),ipv6)
  205. $(INSTALL_BIN) ./files/dhcpd6.init $(1)/etc/init.d/dhcpd6
  206. $(INSTALL_BIN) ./files/dhcpd6.conf $(1)/etc
  207. endif
  208. endef
  209. define Package/isc-dhcp-server-ipv4/conffiles
  210. /etc/dhcpd.conf
  211. endef
  212. define Package/isc-dhcp-server-ipv6/conffiles
  213. /etc/dhcpd6.conf
  214. endef
  215. define Package/isc-dhcp-dyndns-$(BUILD_VARIANT)/install
  216. :
  217. endef
  218. define Package/isc-dhcp-client-$(BUILD_VARIANT)/install
  219. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc
  220. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhclient $(1)/usr/sbin
  221. $(INSTALL_BIN) ./files/dhclient-script $(1)/usr/sbin/
  222. ifeq ($(BUILD_VARIANT),ipv6)
  223. $(INSTALL_BIN) ./files/dhclient6.conf $(1)/etc
  224. endif
  225. endef
  226. define Package/isc-dhcp-client-ipv4/conffiles
  227. /etc/dhclient.conf
  228. endef
  229. define Package/isc-dhcp-client-ipv6/conffiles
  230. /etc/dhclient6.conf
  231. endef
  232. define Package/isc-dhcp-omshell-$(BUILD_VARIANT)/install
  233. $(INSTALL_DIR) $(1)/usr/bin
  234. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/omshell $(1)/usr/bin
  235. endef
  236. $(eval $(call BuildPackage,isc-dhcp-relay-ipv4))
  237. $(eval $(call BuildPackage,isc-dhcp-server-ipv4))
  238. $(eval $(call BuildPackage,isc-dhcp-dyndns-ipv4))
  239. $(eval $(call BuildPackage,isc-dhcp-client-ipv4))
  240. $(eval $(call BuildPackage,isc-dhcp-omshell-ipv4))
  241. $(eval $(call BuildPackage,isc-dhcp-relay-ipv6))
  242. $(eval $(call BuildPackage,isc-dhcp-server-ipv6))
  243. $(eval $(call BuildPackage,isc-dhcp-dyndns-ipv6))
  244. $(eval $(call BuildPackage,isc-dhcp-client-ipv6))
  245. $(eval $(call BuildPackage,isc-dhcp-omshell-ipv6))