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
24 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
25 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
27 include $(INCLUDE_DIR
)/package.mk
29 -include $(LINUX_DIR
)/.config
30 include $(INCLUDE_DIR
)/netfilter.mk
33 define Package
/iptables
/Default
36 URL
:=http
://netfilter.org
/
39 define Package
/iptables
40 $(call Package
/iptables
/Default
)
41 TITLE
:=IPv4 firewall administration tool
45 define Package
/iptables
/conffiles
50 define Package
/iptables-mod-conntrack
51 $(call Package
/iptables
/Default
)
52 DEPENDS
:=iptables
+kmod-ipt-conntrack
53 TITLE
:=connection tracking modules
55 iptables extensions for connection tracking.
\\\
58 - libipt_conntrack
\\\
60 - libipt_connmark
/CONNMARK
63 define Package
/iptables-mod-filter
64 $(call Package
/iptables
/Default
)
65 DEPENDS
:=iptables
+kmod-ipt-filter
68 iptables extensions for packet content inspection.
\\\
75 define Package
/iptables-mod-imq
76 $(call Package
/iptables
/Default
)
80 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
91 iptables extensions for matching
/changing IP packet options.
\\\
94 - libipt_dscp
/DSCP
\\\
104 define Package
/iptables-mod-ipsec
105 $(call Package
/iptables
/Default
)
106 DEPENDS
:=iptables
+kmod-ipt-ipsec
107 TITLE
:=IPSec extensions
109 iptables extensions for matching ipsec traffic.
\\\
116 define Package
/iptables-mod-nat
117 $(call Package
/iptables
/Default
)
118 DEPENDS
:=iptables
+kmod-ipt-nat
119 TITLE
:=extra NAT targets
121 iptables extensions for different NAT targets.
\\\
127 define Package
/iptables-mod-ulog
128 $(call Package
/iptables
/Default
)
129 DEPENDS
:=iptables
+kmod-ipt-ulog
130 TITLE
:=user-space packet logging
132 iptables extensions for user-space packet logging.
\\\
138 define Package
/iptables-mod-extra
139 $(call Package
/iptables
/Default
)
140 DEPENDS
:=iptables
+kmod-ipt-extra
141 TITLE
:=other extra iptables extensions
143 other extra iptables extensions.
\\\
153 define Package
/iptables-utils
154 $(call Package
/iptables
/Default
)
156 TITLE
:=iptables save and restore utilities
159 define Package
/ip6tables
160 $(call Package
/iptables
/Default
)
162 TITLE
:=IPv6 firewall administration tool
165 define Build
/Configure
169 chmod a
+x
$(PKG_BUILD_DIR
)/extensions
/.
*-test*
170 mkdir
-p
$(PKG_INSTALL_DIR
)
171 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
172 $(TARGET_CONFIGURE_OPTS
) \
173 COPT_FLAGS
="$(TARGET_CFLAGS)" \
174 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
175 DESTDIR
="$(PKG_INSTALL_DIR)" \
176 all install install-devel
179 define Build
/InstallDev
180 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
181 $(TARGET_CONFIGURE_OPTS
) \
182 COPT_FLAGS
="$(TARGET_CFLAGS)" \
183 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
184 DESTDIR
="$(STAGING_DIR)" \
185 install install-devel
188 define Build
/UninstallDev
189 rm -rf
$(STAGING_DIR
)/usr
/include/libipq.h
190 rm -rf
$(STAGING_DIR
)/usr
/lib
/libipq.a
193 define Package
/iptables
/install
194 install -d
-m0755
$(1)/etc
/config
195 install -m0644 .
/files
/firewall.config
$(1)/etc
/config
/firewall
196 install -d
-m0755
$(1)/etc
/init.d
197 install -m0755 .
/files
/firewall.init
$(1)/etc
/init.d
/firewall
198 install -m0755 .
/files
/firewall.user
$(1)/etc
/
199 install -d
-m0755
$(1)/usr
/lib
200 install -m0644 .
/files
/firewall.awk
$(1)/usr
/lib
201 install -d
-m0755
$(1)/usr
/sbin
202 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
$(1)/usr
/sbin
/
203 install -d
-m0755
$(1)/usr
/lib
/iptables
204 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
205 $(CP
) $(patsubst %,lib
%.so
,$(IPT_BUILTIN
:xt_
%=ipt_
%)) $(1)/usr
/lib
/iptables
/ \
209 define Package
/iptables-utils
/install
210 install -d
-m0755
$(1)/usr
/sbin
211 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables-
{save
,restore
} $(1)/usr
/sbin
/
214 define Package
/ip6tables
/install
215 install -d
-m0755
$(1)/usr
/sbin
216 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
$(1)/usr
/sbin
/
217 install -d
-m0755
$(1)/usr
/lib
/iptables
218 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
219 $(CP
) libip6t_
*.so
$(1)/usr
/lib
/iptables
/ \
224 define Package
/$(1)/install
225 install -m0755
-d
$$(1)/usr
/lib
/iptables
226 for m in
$$(patsubst xt_
%,ipt_
%,$(2)); do \
227 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
$$(1)/usr
/lib
/iptables
/ ; \
232 $$(eval
$$(call BuildPackage
,$(1)))
235 L7_INSTALL
:=mkdir
-p
$$(1)/etc
/l7-protocols
; \
236 $(CP
) files
/l7
/*.pat
$$(1)/etc
/l7-protocols
/
238 $(eval
$(call BuildPackage
,iptables
))
239 $(eval
$(call BuildPackage
,iptables-utils
))
240 $(eval
$(call BuildPlugin
,iptables-mod-conntrack
,$(IPT_CONNTRACK-m
)))
241 $(eval
$(call BuildPlugin
,iptables-mod-extra
,$(IPT_EXTRA-m
)))
242 $(eval
$(call BuildPlugin
,iptables-mod-filter
,$(IPT_FILTER-m
),$(L7_INSTALL
)))
243 $(eval
$(call BuildPlugin
,iptables-mod-imq
,$(IPT_IMQ-m
)))
244 $(eval
$(call BuildPlugin
,iptables-mod-ipopt
,$(IPT_IPOPT-m
)))
245 $(eval
$(call BuildPlugin
,iptables-mod-ipsec
,$(IPT_IPSEC-m
)))
246 $(eval
$(call BuildPlugin
,iptables-mod-nat
,$(IPT_NAT-m
)))
247 $(eval
$(call BuildPlugin
,iptables-mod-ulog
,$(IPT_ULOG-m
)))
248 $(eval
$(call BuildPackage
,ip6tables
))