portmap: moved to github
[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.2.4
13 PKG_RELEASE:=3
14
15 PKG_SOURCE:=$(UPSTREAM_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION)
17 PKG_MD5SUM:=c244cefe663d43100af757d8ff625a1f
18
19 PKG_FIXUP:=autoreconf
20 PKG_BUILD_PARALLEL:=1
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(UPSTREAM_NAME)-$(PKG_VERSION)
23
24 include $(INCLUDE_DIR)/package.mk
25
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 endef
33
34 define Package/isc-dhcp-relay-ipv4
35   $(call Package/isc-dhcp/Default)
36   TITLE+= relay (without IPv6)
37   VARIANT:=ipv4
38 endef
39
40 define Package/isc-dhcp-relay-ipv6
41   $(call Package/isc-dhcp/Default)
42   DEPENDS:= @IPV6
43   TITLE+= relay (with IPv6)
44   VARIANT:=ipv6
45 endef
46
47 define Package/isc-dhcp-relay/description
48  provides a means for relaying DHCP and BOOTP requests from a subnet to which
49  no DHCP server is directly connected to one or more DHCP servers on other
50  subnets.
51 endef
52
53 define Package/isc-dhcp-relay-ipv4/description
54 $(call Package/isc-dhcp-relay-ipv6/description)
55  This package is compiled with IPv4 support only.
56 endef
57
58 define Package/isc-dhcp-relay-ipv4/conffiles
59 /etc/config/dhcrelay
60 endef
61
62 define Package/isc-dhcp-relay-ipv6/description
63 $(call Package/isc-dhcp-relay/description)
64  This package is compiled with IPv4 and IPv6 support.
65 endef
66
67 define Package/isc-dhcp-relay-ipv6/conffiles
68 /etc/config/dhcrelay
69 endef
70
71 define Package/isc-dhcp-client-ipv4
72   $(call Package/isc-dhcp/Default)
73   TITLE+= client (without IPv6)
74   VARIANT:=ipv4
75 endef
76
77 define Package/isc-dhcp-client-ipv6
78   $(call Package/isc-dhcp/Default)
79   DEPENDS:= @IPV6
80   TITLE+= client (with IPv6)
81   VARIANT:=ipv6
82 endef
83
84 define Package/isc-dhcp-client/description
85  provides a means for configuring one or more network interfaces using the
86  Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols
87  fail, by statically assigning an address.
88 endef
89
90 define Package/isc-dhcp-client-ipv4/description
91 $(call Package/isc-dhcp-client/description)
92  This package is compiled with IPv4 support only.
93 endef
94
95 define Package/isc-dhcp-client-ipv6/description
96 $(call Package/isc-dhcp-client/description)
97  This package is compiled with IPv4 and IPv6 support.
98 endef
99
100 define Package/isc-dhcp-server-ipv4
101   $(call Package/isc-dhcp/Default)
102   TITLE+= server (without IPv6)
103   VARIANT:=ipv4
104 endef
105
106 define Package/isc-dhcp-server-ipv6
107   $(call Package/isc-dhcp/Default)
108   DEPENDS:= @IPV6
109   TITLE+= server (with IPv6)
110   VARIANT:=ipv6
111 endef
112
113 define Package/isc-dhcp-server/description
114  implements the Dynamic Host Configuration Protocol (DHCP) and the Internet
115  Bootstrap Protocol (BOOTP).
116 endef
117
118 define Package/isc-dhcp-server-ipv4/description
119 $(call Package/isc-dhcp-server/description)
120  This package is compiled with IPv4 support only.
121 endef
122
123 define Package/isc-dhcp-server-ipv6/description
124 $(call Package/isc-dhcp-server/description)
125  This package is compiled with IPv4 and IPv6 support.
126 endef
127
128 define Package/isc-dhcp-omshell-ipv4
129   $(call Package/isc-dhcp/Default)
130   DEPENDS:= +isc-dhcp-server-ipv4
131   TITLE+= omshell (without IPv6)
132   VARIANT:=ipv4
133 endef
134
135 define Package/isc-dhcp-omshell-ipv6
136   $(call Package/isc-dhcp/Default)
137   DEPENDS:= @IPV6 +isc-dhcp-server-ipv6
138   TITLE+= omshell (with IPv6)
139   VARIANT:=ipv6
140 endef
141
142 define Package/isc-dhcp-omshell/description
143  provides an interactive way to connect to, query, and possibly change, the ISC
144  DHCP Server's state via OMAPI, the Object Management API.
145 endef
146
147 define Package/isc-dhcp-omshell-ipv4/description
148 $(call Package/isc-dhcp-omshell/description)
149  This package is compiled with IPv4 support only.
150 endef
151
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
157 CONFIGURE_ARGS += \
158         --disable-tracing               \
159         --enable-paranoia               \
160         --disable-dependency-tracking   \
161         ac_cv_file__dev_random=yes
162
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
170 define Build/Compile
171         $(MAKE) -C $(PKG_BUILD_DIR)                     \
172                 DESTDIR="$(PKG_INSTALL_DIR)"            \
173                 BUILD_CC="$(HOSTCC_NOCACHE)"            \
174                 host_alias="$(GNU_TARGET_NAME)"         \
175                 target_alias="$(GNU_TARGET_NAME)"       \
176                 build_alias="$(GNU_HOST_NAME)"          \
177                 ac_cv_file__dev_random=yes              \
178                 all install-exec
179 endef
180
181 define Package/isc-dhcp-relay-$(BUILD_VARIANT)/install
182         $(INSTALL_DIR) $(1)/usr/sbin
183         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcrelay $(1)/usr/sbin
184         $(INSTALL_DIR) $(1)/etc/config
185         $(INSTALL_DATA) ./files/etc/config/dhcrelay $(1)/etc/config
186         $(INSTALL_DIR) $(1)/etc/init.d
187         $(INSTALL_BIN) ./files/dhcrelay4.init $(1)/etc/init.d/dhcrelay4
188 ifeq ($(BUILD_VARIANT),ipv6)
189         $(INSTALL_BIN) ./files/dhcrelay6.init $(1)/etc/init.d/dhcrelay6
190 endif
191 endef
192
193 define Package/isc-dhcp-server-$(BUILD_VARIANT)/install
194         $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
195         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcpd $(1)/usr/sbin
196         $(INSTALL_BIN) ./files/dhcpd.init $(1)/etc/init.d/dhcpd
197         $(INSTALL_BIN) ./files/dhcpd.conf $(1)/etc
198 ifeq ($(BUILD_VARIANT),ipv6)
199         $(INSTALL_BIN) ./files/dhcpd6.init $(1)/etc/init.d/dhcpd6
200         $(INSTALL_BIN) ./files/dhcpd6.conf $(1)/etc
201 endif
202 endef
203
204 define Package/isc-dhcp-client-$(BUILD_VARIANT)/install
205         $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
206         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhclient $(1)/usr/sbin
207         $(INSTALL_BIN) ./files/dhclient-script $(1)/usr/sbin/
208         $(INSTALL_BIN) ./files/dhclient.init $(1)/etc/init.d/dhclient
209 ifeq ($(BUILD_VARIANT),ipv6)
210         $(INSTALL_BIN) ./files/dhclient6.init $(1)/etc/init.d/dhclient6
211         $(INSTALL_BIN) ./files/dhclient6.conf $(1)/etc
212 endif
213 endef
214
215 define Package/isc-dhcp-omshell-$(BUILD_VARIANT)/install
216         $(INSTALL_DIR) $(1)/usr/bin
217         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/omshell $(1)/usr/bin
218 endef
219
220 $(eval $(call BuildPackage,isc-dhcp-relay-ipv4))
221 $(eval $(call BuildPackage,isc-dhcp-server-ipv4))
222 $(eval $(call BuildPackage,isc-dhcp-client-ipv4))
223 $(eval $(call BuildPackage,isc-dhcp-omshell-ipv4))
224 $(eval $(call BuildPackage,isc-dhcp-relay-ipv6))
225 $(eval $(call BuildPackage,isc-dhcp-server-ipv6))
226 $(eval $(call BuildPackage,isc-dhcp-client-ipv6))
227 $(eval $(call BuildPackage,isc-dhcp-omshell-ipv6))