2 # Copyright (C) 2006-2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
10 include $(INCLUDE_DIR
)/kernel.mk
14 ifeq ($(CONFIG_LINUX_2_4
),y
)
17 PKG_MD5SUM
:=0a9209f928002e5eee9cdff8fef4d4b3
18 MAKE_TARGETS
:=experimental install-experimental
21 ifeq ($(CONFIG_LINUX_2_6
),y
)
24 PKG_MD5SUM
:=90cfa8a554a29b0b859a625e701af2a7
27 PKG_VERSION?
=<IPTABLES_VERSION
>
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
/
35 PATCH_DIR
:=.
/patches
/$(PKG_VERSION
)
37 include $(INCLUDE_DIR
)/package.mk
39 -include $(LINUX_DIR
)/.config
40 include $(INCLUDE_DIR
)/netfilter.mk
41 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell grep
'NETFILTER' $(LINUX_DIR
)/.config | md5s
)
44 define Package
/iptables
/Default
47 URL
:=http
://netfilter.org
/
50 define Package
/iptables
/Module
51 $(call Package
/iptables
/Default
)
52 DEPENDS
:=iptables
$(1)
55 define Package
/iptables
56 $(call Package
/iptables
/Default
)
57 TITLE
:=IPv4 firewall administration tool
61 define Package
/iptables-mod-conntrack
62 $(call Package
/iptables
/Module
, +kmod-ipt-conntrack
)
63 TITLE
:=connection tracking modules
66 define Package
/iptables-mod-conntrack
/description
67 iptables extensions for connection tracking.
71 - libipt_connmark
/CONNMARK
74 define Package
/iptables-mod-filter
75 $(call Package
/iptables
/Module
, +kmod-ipt-filter
)
79 define Package
/iptables-mod-filter
/description
80 iptables extensions for packet content inspection.
86 define Package
/iptables-mod-imq
87 $(call Package
/iptables
/Module
, +kmod-ipt-imq
)
91 define Package
/iptables-mod-imq
/description
92 iptables extension for IMQ support.
97 define Package
/iptables-mod-ipopt
98 $(call Package
/iptables
/Module
, +kmod-ipt-ipopt
)
99 TITLE
:=IP
/Packet option modules
102 define Package
/iptables-mod-ipopt
/description
103 iptables extensions for matching
/changing IP packet options.
\\\
118 define Package
/iptables-mod-ipsec
119 $(call Package
/iptables
/Module
, +kmod-ipt-ipsec
)
120 TITLE
:=IPSec extensions
123 define Package
/iptables-mod-ipsec
/description
124 iptables extensions for matching ipsec traffic.
131 define Package
/iptables-mod-nat
132 $(call Package
/iptables
/Module
, +kmod-ipt-nat
)
133 TITLE
:=extra NAT targets
136 define Package
/iptables-mod-nat
/description
137 iptables extensions for different NAT targets.
142 define Package
/iptables-mod-ulog
143 $(call Package
/iptables
/Module
, +kmod-ipt-ulog
)
144 TITLE
:=user-space packet logging
147 define Package
/iptables-mod-ulog
/description
148 iptables extensions for user-space packet logging.
153 define Package
/iptables-mod-iprange
154 $(call Package
/iptables
/Module
, +kmod-ipt-iprange
)
155 TITLE
:=ip range module
158 define Package
/iptables-mod-iprange
/description
159 iptables extensions for matching ip ranges.
164 define Package
/iptables-mod-extra
165 $(call Package
/iptables
/Module
, +kmod-ipt-extra
)
166 TITLE
:=other extra iptables extensions
169 define Package
/iptables-mod-extra
/description
170 other extra iptables extensions.
184 define Package
/iptables-mod-ipset
185 $(call Package
/iptables
/Module
, +kmod-ipt-ipset
)
186 TITLE
:=ipset iptables extension
189 define Package
/iptables-utils
190 $(call Package
/iptables
/Module
, )
191 TITLE
:=iptables save and restore utilities
194 define Package
/ip6tables
195 $(call Package
/iptables
/Default
)
196 DEPENDS
:=+kmod-ip6tables
198 TITLE
:=IPv6 firewall administration tool
202 define Package
/ip6tables-utils
203 $(call Package
/iptables
/Default
)
206 TITLE
:=ip6tables save and restore utilities
210 $(call Build
/Prepare
/Default
)
213 define Build
/Configure
214 chmod a
+x
$(PKG_BUILD_DIR
)/extensions
/.
*-test*
215 rm -f
$(PKG_BUILD_DIR
)/.configured
*
216 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
221 mkdir
-p
$(PKG_INSTALL_DIR
)
222 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
223 $(TARGET_CONFIGURE_OPTS
) \
224 COPT_FLAGS
="$(TARGET_CFLAGS)" \
225 LDFLAGS
="-rdynamic -static-libgcc" \
226 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
227 KBUILD_OUTPUT
="$(LINUX_DIR)" \
228 DESTDIR
="$(PKG_INSTALL_DIR)" \
229 all install $(MAKE_TARGETS
)
232 define Build
/InstallDev
233 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
234 $(TARGET_CONFIGURE_OPTS
) \
235 COPT_FLAGS
="$(TARGET_CFLAGS)" \
236 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
237 KBUILD_OUTPUT
="$(LINUX_DIR)" \
240 $(CP
) $(PKG_BUILD_DIR
)/include $(1)/usr
241 $(CP
) $(PKG_BUILD_DIR
)/libiptc
/libiptc.a
$(1)/usr
/lib
244 define Package
/iptables
/install
245 $(INSTALL_DIR
) $(1)/usr
/sbin
246 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
$(1)/usr
/sbin
/
247 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
248 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
249 for m in
$(patsubst xt_
%,ipt_
%,$(IPT_BUILTIN
)) $(patsubst ipt_
%,xt_
%,$(IPT_BUILTIN
)); do \
250 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$${m}.so
]; then \
251 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$${m}.so
$(1)/usr
/lib
/iptables
/ ;\
257 define Package
/iptables-utils
/install
258 $(INSTALL_DIR
) $(1)/usr
/sbin
259 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables-
{save
,restore
} $(1)/usr
/sbin
/
262 define Package
/ip6tables
/install
263 $(INSTALL_DIR
) $(1)/usr
/sbin
264 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
$(1)/usr
/sbin
/
265 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
266 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
267 $(CP
) libip6t_
*.so
$(1)/usr
/lib
/iptables
/ \
271 define Package
/ip6tables-utils
/install
272 $(INSTALL_DIR
) $(1)/usr
/sbin
273 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables-
{save
,restore
} $(1)/usr
/sbin
/
277 define Package
/$(1)/install
278 $(INSTALL_DIR
) $$(1)/usr
/lib
/iptables
279 for m in
$(patsubst xt_
%,ipt_
%,$(2)) $(patsubst ipt_
%,xt_
%,$(2)); do \
280 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
]; then \
281 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
$$(1)/usr
/lib
/iptables
/ ; \
287 $$(eval
$$(call BuildPackage
,$(1)))
291 $(INSTALL_DIR
) $$(1)/etc
/l7-protocols
; \
292 $(CP
) files
/l7
/*.pat
$$(1)/etc
/l7-protocols
/
294 $(eval
$(call BuildPackage
,iptables
))
295 $(eval
$(call BuildPackage
,iptables-utils
))
296 $(eval
$(call BuildPlugin
,iptables-mod-conntrack
,$(IPT_CONNTRACK-m
)))
297 $(eval
$(call BuildPlugin
,iptables-mod-extra
,$(IPT_EXTRA-m
)))
298 $(eval
$(call BuildPlugin
,iptables-mod-ipset
,$(IPT_IPSET-m
)))
299 $(eval
$(call BuildPlugin
,iptables-mod-filter
,$(IPT_FILTER-m
),$(L7_INSTALL
)))
300 $(eval
$(call BuildPlugin
,iptables-mod-imq
,$(IPT_IMQ-m
)))
301 $(eval
$(call BuildPlugin
,iptables-mod-ipopt
,$(IPT_IPOPT-m
)))
302 $(eval
$(call BuildPlugin
,iptables-mod-ipsec
,$(IPT_IPSEC-m
)))
303 $(eval
$(call BuildPlugin
,iptables-mod-nat
,$(IPT_NAT-m
)))
304 $(eval
$(call BuildPlugin
,iptables-mod-iprange
,$(IPT_IPRANGE-m
)))
305 $(eval
$(call BuildPlugin
,iptables-mod-ulog
,$(IPT_ULOG-m
)))
306 $(eval
$(call BuildPackage
,ip6tables
))
307 $(eval
$(call BuildPackage
,ip6tables-utils
))