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