2 # Copyright (C) 2006 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
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
17 PKG_SOURCE_URL
:=http
://www.netfilter.org
/projects
/iptables
/files \
18 ftp
://ftp.be.netfilter.org
/pub
/netfilter
/iptables
/ \
19 ftp
://ftp.de.netfilter.org
/pub
/netfilter
/iptables
/ \
20 ftp
://ftp.no.netfilter.org
/pub
/netfilter
/iptables
/
21 PKG_MD5SUM
:=0a9209f928002e5eee9cdff8fef4d4b3
23 include $(INCLUDE_DIR
)/package.mk
25 -include $(LINUX_DIR
)/.config
26 include $(INCLUDE_DIR
)/netfilter.mk
27 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell grep
'NETFILTER' $(LINUX_DIR
)/.config | md5s
)
30 define Package
/iptables
/Default
33 URL
:=http
://netfilter.org
/
36 define Package
/iptables
37 $(call Package
/iptables
/Default
)
38 TITLE
:=IPv4 firewall administration tool
42 define Package
/iptables
/conffiles
47 define Package
/iptables-mod-conntrack
48 $(call Package
/iptables
/Default
)
49 DEPENDS
:=iptables
+kmod-ipt-conntrack
50 TITLE
:=connection tracking modules
53 define Package
/iptables-mod-conntrack
/description
54 iptables extensions for connection tracking.
58 - libipt_connmark
/CONNMARK
61 define Package
/iptables-mod-filter
62 $(call Package
/iptables
/Default
)
63 DEPENDS
:=iptables
+kmod-ipt-filter
67 define Package
/iptables-mod-filter
/description
68 iptables extensions for packet content inspection.
74 define Package
/iptables-mod-imq
75 $(call Package
/iptables
/Default
)
76 DEPENDS
:=iptables
+kmod-ipt-imq
80 define Package
/iptables-mod-imq
/description
81 iptables extension for IMQ support.
86 define Package
/iptables-mod-ipopt
87 $(call Package
/iptables
/Default
)
88 DEPENDS
:=iptables
+kmod-ipt-ipopt
89 TITLE
:=IP
/Packet option modules
92 define Package
/iptables-mod-ipopt
/description
93 iptables extensions for matching
/changing IP packet options.
\\\
108 define Package
/iptables-mod-ipsec
109 $(call Package
/iptables
/Default
)
110 DEPENDS
:=iptables
+kmod-ipt-ipsec
111 TITLE
:=IPSec extensions
114 define Package
/iptables-mod-ipsec
/description
115 iptables extensions for matching ipsec traffic.
122 define Package
/iptables-mod-nat
123 $(call Package
/iptables
/Default
)
124 DEPENDS
:=iptables
+kmod-ipt-nat
125 TITLE
:=extra NAT targets
128 define Package
/iptables-mod-nat
/description
129 iptables extensions for different NAT targets.
134 define Package
/iptables-mod-ulog
135 $(call Package
/iptables
/Default
)
136 DEPENDS
:=iptables
+kmod-ipt-ulog
137 TITLE
:=user-space packet logging
140 define Package
/iptables-mod-ulog
/description
141 iptables extensions for user-space packet logging.
146 define Package
/iptables-mod-iprange
147 $(call Package
/iptables
/Default
)
148 DEPENDS
:=iptables
+kmod-ipt-iprange
149 TITLE
:=ip range module
152 define Package
/iptables-mod-iprange
/description
153 iptables extensions for matching ip ranges.
158 define Package
/iptables-mod-extra
159 $(call Package
/iptables
/Default
)
160 DEPENDS
:=iptables
+kmod-ipt-extra
161 TITLE
:=other extra iptables extensions
164 define Package
/iptables-mod-extra
/description
165 other extra iptables extensions.
179 define Package
/iptables-mod-ipset
180 $(call Package
/iptables
/Default
)
181 DEPENDS
:=iptables
+kmod-ipt-ipset
182 TITLE
:=ipset iptables extension
185 define Package
/iptables-utils
186 $(call Package
/iptables
/Default
)
188 TITLE
:=iptables save and restore utilities
191 define Package
/ip6tables
192 $(call Package
/iptables
/Default
)
195 TITLE
:=IPv6 firewall administration tool
198 define Package
/ip6tables-utils
199 $(call Package
/iptables
/Default
)
202 TITLE
:=ip6tables save and restore utilities
206 $(call Build
/Prepare
/Default
)
207 chmod a
+x
$(PKG_BUILD_DIR
)/extensions
/.
*-test*
210 define Build
/Configure
211 rm -f
$(PKG_BUILD_DIR
)/.configured
*
212 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
217 mkdir
-p
$(PKG_INSTALL_DIR
)
218 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
219 $(TARGET_CONFIGURE_OPTS
) \
220 COPT_FLAGS
="$(TARGET_CFLAGS)" \
221 LDFLAGS
="-rdynamic -static-libgcc" \
222 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
223 DESTDIR
="$(PKG_INSTALL_DIR)" \
224 all experimental
install install-experimental
227 define Build
/InstallDev
228 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
229 $(TARGET_CONFIGURE_OPTS
) \
230 COPT_FLAGS
="$(TARGET_CFLAGS)" \
231 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
234 $(CP
) $(PKG_BUILD_DIR
)/include $(1)/usr
235 $(CP
) $(PKG_BUILD_DIR
)/libiptc
/libiptc.a
$(1)/usr
/lib
238 define Package
/iptables
/install
239 $(INSTALL_DIR
) $(1)/etc
/config
240 $(INSTALL_DATA
) .
/files
/firewall.config
$(1)/etc
/config
/firewall
241 $(INSTALL_DIR
) $(1)/etc
/init.d
242 $(INSTALL_BIN
) .
/files
/firewall.init
$(1)/etc
/init.d
/firewall
243 $(INSTALL_BIN
) .
/files
/firewall.user
$(1)/etc
/
244 $(INSTALL_DIR
) $(1)/usr
/lib
245 $(INSTALL_DATA
) .
/files
/firewall.awk
$(1)/usr
/lib
246 $(INSTALL_DIR
) $(1)/usr
/sbin
247 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
$(1)/usr
/sbin
/
248 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
249 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
250 $(CP
) $(patsubst %,lib
%.so
,$(IPT_BUILTIN
:xt_
%=ipt_
%)) $(1)/usr
/lib
/iptables
/ \
254 define Package
/iptables-utils
/install
255 $(INSTALL_DIR
) $(1)/usr
/sbin
256 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables-
{save
,restore
} $(1)/usr
/sbin
/
259 define Package
/ip6tables
/install
260 $(INSTALL_DIR
) $(1)/usr
/sbin
261 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
$(1)/usr
/sbin
/
262 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
263 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
264 $(CP
) libip6t_
*.so
$(1)/usr
/lib
/iptables
/ \
268 define Package
/ip6tables-utils
/install
269 $(INSTALL_DIR
) $(1)/usr
/sbin
270 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables-
{save
,restore
} $(1)/usr
/sbin
/
274 define Package
/$(1)/install
275 $(INSTALL_DIR
) $$(1)/usr
/lib
/iptables
276 for m in
$$(patsubst xt_
%,ipt_
%,$(2)); do \
277 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
$$(1)/usr
/lib
/iptables
/ ; \
282 $$(eval
$$(call BuildPackage
,$(1)))
286 $(INSTALL_DIR
) $$(1)/etc
/l7-protocols
; \
287 $(CP
) files
/l7
/*.pat
$$(1)/etc
/l7-protocols
/
289 $(eval
$(call BuildPackage
,iptables
))
290 $(eval
$(call BuildPackage
,iptables-utils
))
291 $(eval
$(call BuildPlugin
,iptables-mod-conntrack
,$(IPT_CONNTRACK-m
)))
292 $(eval
$(call BuildPlugin
,iptables-mod-extra
,$(IPT_EXTRA-m
)))
293 $(eval
$(call BuildPlugin
,iptables-mod-ipset
,$(IPT_IPSET-m
)))
294 $(eval
$(call BuildPlugin
,iptables-mod-filter
,$(IPT_FILTER-m
),$(L7_INSTALL
)))
295 $(eval
$(call BuildPlugin
,iptables-mod-imq
,$(IPT_IMQ-m
)))
296 $(eval
$(call BuildPlugin
,iptables-mod-ipopt
,$(IPT_IPOPT-m
)))
297 $(eval
$(call BuildPlugin
,iptables-mod-ipsec
,$(IPT_IPSEC-m
)))
298 $(eval
$(call BuildPlugin
,iptables-mod-nat
,$(IPT_NAT-m
)))
299 $(eval
$(call BuildPlugin
,iptables-mod-iprange
,$(IPT_IPRANGE-m
)))
300 $(eval
$(call BuildPlugin
,iptables-mod-ulog
,$(IPT_ULOG-m
)))
301 $(eval
$(call BuildPackage
,ip6tables
))
302 $(eval
$(call BuildPackage
,ip6tables-utils
))