[kernel] update to 2.6.28.4
[openwrt.git] / package / iptables / Makefile
1 #
2 # Copyright (C) 2006-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=iptables
13
14 ifeq ($(CONFIG_LINUX_2_4),y)
15 PKG_VERSION:=1.3.8
16 PKG_RELEASE:=4
17 PKG_MD5SUM:=0a9209f928002e5eee9cdff8fef4d4b3
18 MAKE_TARGETS:=experimental install-experimental install-devel
19 endif
20
21 ifeq ($(CONFIG_LINUX_2_6),y)
22 PKG_VERSION:=1.4.1.1
23 PKG_RELEASE:=1
24 PKG_MD5SUM:=723fa88d8a0915e184f99e03e9bf06cb
25 endif
26
27 PKG_VERSION?=<IPTABLES_VERSION>
28
29 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
30 PKG_SOURCE_URL:=http://www.netfilter.org/projects/iptables/files \
31 ftp://ftp.be.netfilter.org/pub/netfilter/iptables/ \
32 ftp://ftp.de.netfilter.org/pub/netfilter/iptables/ \
33 ftp://ftp.no.netfilter.org/pub/netfilter/iptables/
34
35 PATCH_DIR:=./patches/$(PKG_VERSION)
36
37 include $(INCLUDE_DIR)/package.mk
38 ifeq ($(DUMP),)
39 -include $(LINUX_DIR)/.config
40 include $(INCLUDE_DIR)/netfilter.mk
41 STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep 'NETFILTER' $(LINUX_DIR)/.config | md5s)
42 endif
43
44 define Package/iptables/Default
45 SECTION:=net
46 CATEGORY:=Base system
47 URL:=http://netfilter.org/
48 endef
49
50 define Package/iptables/Module
51 $(call Package/iptables/Default)
52 DEPENDS:=iptables $(1)
53 endef
54
55 define Package/iptables
56 $(call Package/iptables/Default)
57 TITLE:=IPv4 firewall administration tool
58 MENU:=1
59 DEPENDS+= +kmod-ipt-core
60 endef
61
62 define Package/iptables/description
63 IPv4 firewall administration tool.
64 Includes support for:
65 - limit
66 - LOG
67 - mac
68 - multiport
69 - REJECT
70 - TCPMSS
71 endef
72
73 define Package/iptables-mod-conntrack
74 $(call Package/iptables/Module, +kmod-ipt-conntrack)
75 TITLE:=Basic connection tracking extensions
76 endef
77
78 define Package/iptables-mod-conntrack/description
79 Basic iptables extensions for connection tracking.
80 Includes:
81 - state
82 endef
83
84 define Package/iptables-mod-conntrack-extra
85 $(call Package/iptables/Module, +kmod-ipt-conntrack-extra)
86 TITLE:=Extra connection tracking extensions
87 endef
88
89 define Package/iptables-mod-conntrack-extra/description
90 Extra iptables extensions for connection tracking.
91 Includes:
92 - libipt_conntrack
93 - libipt_helper
94 - libipt_connmark/CONNMARK
95 endef
96
97 define Package/iptables-mod-filter
98 $(call Package/iptables/Module, +kmod-ipt-filter)
99 TITLE:=Content inspection extensions
100 endef
101
102 define Package/iptables-mod-filter/description
103 iptables extensions for packet content inspection.
104 Includes:
105 - libipt_ipp2p
106 - libipt_layer7
107 endef
108
109 define Package/iptables-mod-imq
110 $(call Package/iptables/Module, +kmod-ipt-imq @!LINUX_2_6_27)
111 TITLE:=IMQ support
112 endef
113
114 define Package/iptables-mod-imq/description
115 iptables extension for IMQ support.
116 Includes:
117 - libipt_IMQ
118 endef
119
120 define Package/iptables-mod-ipopt
121 $(call Package/iptables/Module, +kmod-ipt-ipopt)
122 TITLE:=IP/Packet option extensions
123 endef
124
125 define Package/iptables-mod-ipopt/description
126 iptables extensions for matching/changing IP packet options.
127 Includes:
128 - libipt_CLASSIFY
129 - libipt_dscp/DSCP
130 - libipt_ecn/ECN
131 - libipt_length
132 - libipt_mac
133 - libipt_mark/MARK
134 - libipt_statistic
135 - libipt_tcpmms
136 - libipt_tos/TOS
137 - libipt_ttl/TTL
138 - libipt_unclean
139 endef
140
141 define Package/iptables-mod-ipsec
142 $(call Package/iptables/Module, +kmod-ipt-ipsec)
143 TITLE:=IPsec extensions
144 endef
145
146 define Package/iptables-mod-ipsec/description
147 iptables extensions for matching ipsec traffic.
148 Includes:
149 - libipt_ah
150 - libipt_esp
151 - libipt_policy
152 endef
153
154 define Package/iptables-mod-nat
155 $(call Package/iptables/Module, +kmod-ipt-nat)
156 TITLE:=Basic NAT extensions
157 endef
158
159 define Package/iptables-mod-nat/description
160 iptables extensions for basic NAT targets.
161 Includes:
162 - MASQUERADE
163 - SNAT
164 - DNAT
165 endef
166
167 define Package/iptables-mod-nat-extra
168 $(call Package/iptables/Module, +kmod-ipt-nat-extra)
169 TITLE:=Extra NAT extensions
170 endef
171
172 define Package/iptables-mod-nat-extra/description
173 iptables extensions for extra NAT targets.
174 Includes:
175 - REDIRECT
176 endef
177
178 define Package/iptables-mod-ulog
179 $(call Package/iptables/Module, +kmod-ipt-ulog)
180 TITLE:=user-space packet logging
181 endef
182
183 define Package/iptables-mod-ulog/description
184 iptables extensions for user-space packet logging.
185 Includes:
186 - libipt_ULOG
187 endef
188
189 define Package/iptables-mod-iprange
190 $(call Package/iptables/Module, +kmod-ipt-iprange)
191 TITLE:=IP range extension
192 endef
193
194 define Package/iptables-mod-iprange/description
195 iptables extensions for matching ip ranges.
196 Includes:
197 - libipt_iprange
198 endef
199
200 define Package/iptables-mod-extra
201 $(call Package/iptables/Module, +kmod-ipt-extra)
202 TITLE:=Other extra iptables extensions
203 endef
204
205 define Package/iptables-mod-extra/description
206 other extra iptables extensions.
207 Includes:
208 - libipt_owner
209 - libipt_physdev
210 - libipt_pkttype
211 - libipt_recent
212 - iptable_raw
213 - libipt_NOTRACK
214 - libipt_TARPIT
215 - libipt_DELUDE
216 - libipt_CHAOS
217 endef
218
219 define Package/iptables-mod-ipset
220 $(call Package/iptables/Module, +kmod-ipt-ipset)
221 TITLE:=IPset extension
222 endef
223
224 define Package/iptables-utils
225 $(call Package/iptables/Module, )
226 TITLE:=iptables save and restore utilities
227 endef
228
229 define Package/ip6tables
230 $(call Package/iptables/Default)
231 DEPENDS:=+kmod-ip6tables
232 CATEGORY:=IPv6
233 TITLE:=IPv6 firewall administration tool
234 MENU:=1
235 endef
236
237 define Package/ip6tables-utils
238 $(call Package/iptables/Default)
239 DEPENDS:=ip6tables
240 CATEGORY:=IPv6
241 TITLE:=ip6tables save and restore utilities
242 endef
243
244 define Build/Prepare
245 $(call Build/Prepare/Default)
246 endef
247
248 ifeq ($(KERNEL),2.4)
249 define Build/Configure
250 chmod a+x $(PKG_BUILD_DIR)/extensions/.*-test*
251 rm -f $(PKG_BUILD_DIR)/.configured*
252 $(MAKE) -C $(PKG_BUILD_DIR) \
253 clean
254 endef
255 endif
256
257 TARGET_CPPFLAGS := -I$(PKG_BUILD_DIR)/include $(TARGET_CPPFLAGS)
258 TARGET_CFLAGS += $(FPIC)
259 CONFIGURE_ARGS += \
260 --enable-devel \
261 --with-kernel="$(LINUX_DIR)" \
262 --with-xtlibdir=/usr/lib/iptables
263
264 define Build/Compile
265 mkdir -p $(PKG_INSTALL_DIR)
266 $(MAKE) -C $(PKG_BUILD_DIR) \
267 $(TARGET_CONFIGURE_OPTS) \
268 COPT_FLAGS="$(TARGET_CFLAGS)" \
269 LDFLAGS="-rdynamic -static-libgcc" \
270 KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
271 KBUILD_OUTPUT="$(LINUX_DIR)" \
272 DESTDIR="$(PKG_INSTALL_DIR)" \
273 all install $(MAKE_TARGETS)
274 endef
275
276 define Build/InstallDev
277 $(INSTALL_DIR) $(1)/usr/lib
278 $(CP) $(PKG_BUILD_DIR)/include $(1)/usr
279 $(CP) $(PKG_BUILD_DIR)/libiptc/libiptc.a $(1)/usr/lib
280 endef
281
282 define Package/iptables/install
283 $(INSTALL_DIR) $(1)/usr/sbin
284 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/iptables $(1)/usr/sbin/
285 $(INSTALL_DIR) $(1)/usr/lib/iptables
286 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
287 for m in $(patsubst xt_%,ipt_%,$(IPT_BUILTIN)) $(patsubst ipt_%,xt_%,$(IPT_BUILTIN)); do \
288 if [ -f $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$${m}.so ]; then \
289 $(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$${m}.so $(1)/usr/lib/iptables/ ;\
290 fi; \
291 done \
292 )
293 endef
294
295 define Package/iptables-utils/install
296 $(INSTALL_DIR) $(1)/usr/sbin
297 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/iptables-{save,restore} $(1)/usr/sbin/
298 endef
299
300 define Package/ip6tables/install
301 $(INSTALL_DIR) $(1)/usr/sbin
302 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables $(1)/usr/sbin/
303 $(INSTALL_DIR) $(1)/usr/lib/iptables
304 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
305 $(CP) libip6t_*.so $(1)/usr/lib/iptables/ \
306 )
307 endef
308
309 define Package/ip6tables-utils/install
310 $(INSTALL_DIR) $(1)/usr/sbin
311 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables-{save,restore} $(1)/usr/sbin/
312 endef
313
314 define BuildPlugin
315 define Package/$(1)/install
316 $(INSTALL_DIR) $$(1)/usr/lib/iptables
317 for m in $(patsubst xt_%,ipt_%,$(2)) $(patsubst ipt_%,xt_%,$(2)); do \
318 if [ -f $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so ]; then \
319 $(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so $$(1)/usr/lib/iptables/ ; \
320 fi; \
321 done
322 $(3)
323 endef
324
325 $$(eval $$(call BuildPackage,$(1)))
326 endef
327
328 L7_INSTALL:=\
329 $(INSTALL_DIR) $$(1)/etc/l7-protocols; \
330 $(CP) files/l7/*.pat $$(1)/etc/l7-protocols/
331
332 $(eval $(call BuildPackage,iptables))
333 $(eval $(call BuildPackage,iptables-utils))
334 $(eval $(call BuildPlugin,iptables-mod-conntrack,$(IPT_CONNTRACK-m)))
335 $(eval $(call BuildPlugin,iptables-mod-conntrack-extra,$(IPT_CONNTRACK_EXTRA-m)))
336 $(eval $(call BuildPlugin,iptables-mod-extra,$(IPT_EXTRA-m)))
337 $(eval $(call BuildPlugin,iptables-mod-ipset,$(IPT_IPSET-m)))
338 $(eval $(call BuildPlugin,iptables-mod-filter,$(IPT_FILTER-m),$(L7_INSTALL)))
339 $(eval $(call BuildPlugin,iptables-mod-imq,$(IPT_IMQ-m)))
340 $(eval $(call BuildPlugin,iptables-mod-ipopt,$(IPT_IPOPT-m)))
341 $(eval $(call BuildPlugin,iptables-mod-ipsec,$(IPT_IPSEC-m)))
342 $(eval $(call BuildPlugin,iptables-mod-nat,$(IPT_NAT-m)))
343 $(eval $(call BuildPlugin,iptables-mod-nat-extra,$(IPT_NAT_EXTRA-m)))
344 $(eval $(call BuildPlugin,iptables-mod-iprange,$(IPT_IPRANGE-m)))
345 $(eval $(call BuildPlugin,iptables-mod-ulog,$(IPT_ULOG-m)))
346 $(eval $(call BuildPackage,ip6tables))
347 $(eval $(call BuildPackage,ip6tables-utils))
This page took 0.054391 seconds and 5 git commands to generate.