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