1
0

Makefile 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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:=1
  12. PKG_LICENSE:=BSD-3-Clause
  13. PKG_LICENSE_FILES:=LICENSE
  14. PKG_MAINTAINER:=Antony Antony <antony@phenome.org>
  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
  169. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
  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.conf $(1)/etc
  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))