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
:=00fb916fa8040ca992a5ace56d905ea5
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
52 iptables extensions for connection tracking.
\\\
55 - libipt_conntrack
\\\
57 - libipt_connmark
/CONNMARK
60 define Package
/iptables-mod-filter
61 $(call Package
/iptables
/Default
)
62 DEPENDS
:=iptables
+kmod-ipt-filter
65 iptables extensions for packet content inspection.
\\\
72 define Package
/iptables-mod-imq
73 $(call Package
/iptables
/Default
)
74 DEPENDS
:=iptables
+kmod-ipt-imq
77 iptables extension for IMQ support.
\\\
83 define Package
/iptables-mod-ipopt
84 $(call Package
/iptables
/Default
)
85 DEPENDS
:=iptables
+kmod-ipt-ipopt
86 TITLE
:=IP
/Packet option modules
88 iptables extensions for matching
/changing IP packet options.
\\\
92 - libipt_dscp
/DSCP
\\\
102 define Package
/iptables-mod-ipsec
103 $(call Package
/iptables
/Default
)
104 DEPENDS
:=iptables
+kmod-ipt-ipsec
105 TITLE
:=IPSec extensions
107 iptables extensions for matching ipsec traffic.
\\\
114 define Package
/iptables-mod-nat
115 $(call Package
/iptables
/Default
)
116 DEPENDS
:=iptables
+kmod-ipt-nat
117 TITLE
:=extra NAT targets
119 iptables extensions for different NAT targets.
\\\
125 define Package
/iptables-mod-ulog
126 $(call Package
/iptables
/Default
)
127 DEPENDS
:=iptables
+kmod-ipt-ulog
128 TITLE
:=user-space packet logging
130 iptables extensions for user-space packet logging.
\\\
136 define Package
/iptables-mod-extra
137 $(call Package
/iptables
/Default
)
138 DEPENDS
:=iptables
+kmod-ipt-extra
139 TITLE
:=other extra iptables extensions
141 other extra iptables extensions.
\\\
151 define Package
/iptables-utils
152 $(call Package
/iptables
/Default
)
154 TITLE
:=iptables save and restore utilities
157 define Package
/ip6tables
158 $(call Package
/iptables
/Default
)
160 TITLE
:=IPv6 firewall administration tool
163 define Build
/Configure
164 rm -f
$(PKG_BUILD_DIR
)/.configured
*
165 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
170 chmod a
+x
$(PKG_BUILD_DIR
)/extensions
/.
*-test*
171 mkdir
-p
$(PKG_INSTALL_DIR
)
172 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
173 $(TARGET_CONFIGURE_OPTS
) \
174 COPT_FLAGS
="$(TARGET_CFLAGS)" \
175 LDFLAGS
="-rdynamic -static-libgcc" \
176 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
177 DESTDIR
="$(PKG_INSTALL_DIR)" \
181 define Build
/InstallDev
182 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
183 $(TARGET_CONFIGURE_OPTS
) \
184 COPT_FLAGS
="$(TARGET_CFLAGS)" \
185 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
186 DESTDIR
="$(STAGING_DIR)" \
188 $(CP
) $(PKG_BUILD_DIR
)/include $(STAGING_DIR
)/usr
189 $(CP
) $(PKG_BUILD_DIR
)/libiptc
/libiptc.a
$(STAGING_DIR
)/usr
/lib
192 define Build
/UninstallDev
193 rm -rf
$(STAGING_DIR
)/usr
/include/libipq.h
194 rm -rf
$(STAGING_DIR
)/usr
/include/libipulog
195 rm -rf
$(STAGING_DIR
)/usr
/include/libipq
196 rm -rf
$(STAGING_DIR
)/usr
/include/libiptc
197 rm -rf
$(STAGING_DIR
)/usr
/include/linux
/netfilter
*
198 rm -rf
$(STAGING_DIR
)/usr
/include/iptables
*
199 rm -rf
$(STAGING_DIR
)/usr
/include/ip6tables
*
200 rm -rf
$(STAGING_DIR
)/usr
/lib
/libipq.a
201 rm -rf
$(STAGING_DIR
)/usr
/lib
/libiptc.a
204 define Package
/iptables
/install
205 $(INSTALL_DIR
) $(1)/etc
/config
206 $(INSTALL_DATA
) .
/files
/firewall.config
$(1)/etc
/config
/firewall
207 $(INSTALL_DIR
) $(1)/etc
/init.d
208 $(INSTALL_BIN
) .
/files
/firewall.init
$(1)/etc
/init.d
/firewall
209 $(INSTALL_BIN
) .
/files
/firewall.user
$(1)/etc
/
210 $(INSTALL_DIR
) $(1)/usr
/lib
211 $(INSTALL_DATA
) .
/files
/firewall.awk
$(1)/usr
/lib
212 $(INSTALL_DIR
) $(1)/usr
/sbin
213 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
$(1)/usr
/sbin
/
214 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
215 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
216 $(CP
) $(patsubst %,lib
%.so
,$(IPT_BUILTIN
:xt_
%=ipt_
%)) $(1)/usr
/lib
/iptables
/ \
220 define Package
/iptables-utils
/install
221 $(INSTALL_DIR
) $(1)/usr
/sbin
222 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables-
{save
,restore
} $(1)/usr
/sbin
/
225 define Package
/ip6tables
/install
226 $(INSTALL_DIR
) $(1)/usr
/sbin
227 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
$(1)/usr
/sbin
/
228 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
229 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
230 $(CP
) libip6t_
*.so
$(1)/usr
/lib
/iptables
/ \
235 define Package
/$(1)/install
236 $(INSTALL_DIR
) $$(1)/usr
/lib
/iptables
237 for m in
$$(patsubst xt_
%,ipt_
%,$(2)); do \
238 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
$$(1)/usr
/lib
/iptables
/ ; \
243 $$(eval
$$(call BuildPackage
,$(1)))
247 $(INSTALL_DIR
) $$(1)/etc
/l7-protocols
; \
248 $(CP
) files
/l7
/*.pat
$$(1)/etc
/l7-protocols
/
250 $(eval
$(call BuildPackage
,iptables
))
251 $(eval
$(call BuildPackage
,iptables-utils
))
252 $(eval
$(call BuildPlugin
,iptables-mod-conntrack
,$(IPT_CONNTRACK-m
)))
253 $(eval
$(call BuildPlugin
,iptables-mod-extra
,$(IPT_EXTRA-m
)))
254 $(eval
$(call BuildPlugin
,iptables-mod-filter
,$(IPT_FILTER-m
),$(L7_INSTALL
)))
255 $(eval
$(call BuildPlugin
,iptables-mod-imq
,$(IPT_IMQ-m
)))
256 $(eval
$(call BuildPlugin
,iptables-mod-ipopt
,$(IPT_IPOPT-m
)))
257 $(eval
$(call BuildPlugin
,iptables-mod-ipsec
,$(IPT_IPSEC-m
)))
258 $(eval
$(call BuildPlugin
,iptables-mod-nat
,$(IPT_NAT-m
)))
259 $(eval
$(call BuildPlugin
,iptables-mod-ulog
,$(IPT_ULOG-m
)))
260 $(eval
$(call BuildPackage
,ip6tables
))