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
) \
220 TARGET_CFLAGS
+= $(FPIC
)
223 mkdir
-p
$(PKG_INSTALL_DIR
)
224 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
225 $(TARGET_CONFIGURE_OPTS
) \
226 COPT_FLAGS
="$(TARGET_CFLAGS)" \
227 LDFLAGS
="-rdynamic -static-libgcc" \
228 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
229 KBUILD_OUTPUT
="$(LINUX_DIR)" \
230 DESTDIR
="$(PKG_INSTALL_DIR)" \
231 all install $(MAKE_TARGETS
)
234 define Build
/InstallDev
235 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
236 $(TARGET_CONFIGURE_OPTS
) \
237 COPT_FLAGS
="$(TARGET_CFLAGS)" \
238 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
239 KBUILD_OUTPUT
="$(LINUX_DIR)" \
242 $(CP
) $(PKG_BUILD_DIR
)/include $(1)/usr
243 $(CP
) $(PKG_BUILD_DIR
)/libiptc
/libiptc.a
$(1)/usr
/lib
246 define Package
/iptables
/install
247 $(INSTALL_DIR
) $(1)/usr
/sbin
248 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
$(1)/usr
/sbin
/
249 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
250 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
251 for m in
$(patsubst xt_
%,ipt_
%,$(IPT_BUILTIN
)) $(patsubst ipt_
%,xt_
%,$(IPT_BUILTIN
)); do \
252 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$${m}.so
]; then \
253 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$${m}.so
$(1)/usr
/lib
/iptables
/ ;\
259 define Package
/iptables-utils
/install
260 $(INSTALL_DIR
) $(1)/usr
/sbin
261 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables-
{save
,restore
} $(1)/usr
/sbin
/
264 define Package
/ip6tables
/install
265 $(INSTALL_DIR
) $(1)/usr
/sbin
266 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
$(1)/usr
/sbin
/
267 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
268 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
269 $(CP
) libip6t_
*.so
$(1)/usr
/lib
/iptables
/ \
273 define Package
/ip6tables-utils
/install
274 $(INSTALL_DIR
) $(1)/usr
/sbin
275 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables-
{save
,restore
} $(1)/usr
/sbin
/
279 define Package
/$(1)/install
280 $(INSTALL_DIR
) $$(1)/usr
/lib
/iptables
281 for m in
$(patsubst xt_
%,ipt_
%,$(2)) $(patsubst ipt_
%,xt_
%,$(2)); do \
282 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
]; then \
283 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
$$(1)/usr
/lib
/iptables
/ ; \
289 $$(eval
$$(call BuildPackage
,$(1)))
293 $(INSTALL_DIR
) $$(1)/etc
/l7-protocols
; \
294 $(CP
) files
/l7
/*.pat
$$(1)/etc
/l7-protocols
/
296 $(eval
$(call BuildPackage
,iptables
))
297 $(eval
$(call BuildPackage
,iptables-utils
))
298 $(eval
$(call BuildPlugin
,iptables-mod-conntrack
,$(IPT_CONNTRACK-m
)))
299 $(eval
$(call BuildPlugin
,iptables-mod-extra
,$(IPT_EXTRA-m
)))
300 $(eval
$(call BuildPlugin
,iptables-mod-ipset
,$(IPT_IPSET-m
)))
301 $(eval
$(call BuildPlugin
,iptables-mod-filter
,$(IPT_FILTER-m
),$(L7_INSTALL
)))
302 $(eval
$(call BuildPlugin
,iptables-mod-imq
,$(IPT_IMQ-m
)))
303 $(eval
$(call BuildPlugin
,iptables-mod-ipopt
,$(IPT_IPOPT-m
)))
304 $(eval
$(call BuildPlugin
,iptables-mod-ipsec
,$(IPT_IPSEC-m
)))
305 $(eval
$(call BuildPlugin
,iptables-mod-nat
,$(IPT_NAT-m
)))
306 $(eval
$(call BuildPlugin
,iptables-mod-iprange
,$(IPT_IPRANGE-m
)))
307 $(eval
$(call BuildPlugin
,iptables-mod-ulog
,$(IPT_ULOG-m
)))
308 $(eval
$(call BuildPackage
,ip6tables
))
309 $(eval
$(call BuildPackage
,ip6tables-utils
))