3 include $(TOPDIR
)/rules.mk
4 include $(TOPDIR
)/package
/kernel.mk
10 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
11 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
12 PKG_SOURCE_URL
:=http
://www.netfilter.org
/projects
/iptables
/files \
13 ftp
://ftp.be.netfilter.org
/pub
/netfilter
/iptables
/ \
14 ftp
://ftp.de.netfilter.org
/pub
/netfilter
/iptables
/ \
15 ftp
://ftp.no.netfilter.org
/pub
/netfilter
/iptables
/
16 PKG_MD5SUM
:=00fb916fa8040ca992a5ace56d905ea5
19 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
21 PKG_MENU
:=IPv4
/ IPv6 firewall administration
23 include $(TOPDIR
)/package
/rules.mk
25 include $(LINUX_DIR
)/.config
26 include $(TOPDIR
)/target
/linux
/netfilter.mk
29 define Package
/iptables
34 TITLE
:=IPv4 firewall administration tool
35 URL
:=http
://netfilter.org
/
38 define Package
/iptables
/conffiles
43 define Package
/iptables-mod-conntrack
47 TITLE
:=connection tracking modules
48 DESCRIPTION
:=iptables extensions for connection tracking
\\\
50 * libipt_conntrack
\\\
52 * libipt_connmark
/CONNMARK
56 define Package
/iptables-mod-filter
61 DESCRIPTION
:=iptables extensions for packet content inspection
\\\
68 define Package
/iptables-mod-imq
73 DESCRIPTION
:=iptables extension for IMQ support
\\\
79 define Package
/iptables-mod-ipopt
83 TITLE
:=IP
/Packet option modules
84 DESCRIPTION
:=iptables extensions for matching
/changing IP packet options
\\\
86 * libipt_dscp
/DSCP
\\\
97 define Package
/iptables-mod-ipsec
101 TITLE
:=IPSec extensions
102 DESCRIPTION
:=iptables extensions for matching ipsec traffic
\\\
109 define Package
/iptables-mod-nat
111 CATEGORY
:=Base system
113 TITLE
:=extra NAT targets
114 DESCRIPTION
:=iptables extensions for different NAT targets
\\\
119 define Package
/iptables-mod-ulog
121 CATEGORY
:=Base system
123 TITLE
:=user-space packet logging
124 DESCRIPTION
:=iptables extensions for user-space packet logging
\\\
129 define Package
/iptables-mod-extra
131 CATEGORY
:=Base system
133 TITLE
:=other extra iptables extensions
134 DESCRIPTION
:=other extra iptables extensions
\\\
144 define Package
/iptables-utils
146 CATEGORY
:=Base system
148 TITLE
:=iptables save and restore utilities
151 define Package
/ip6tables
153 CATEGORY
:=Base system
154 TITLE
:=IPv6 firewall administration tool
158 define Build
/Configure
162 chmod a
+x
$(PKG_BUILD_DIR
)/extensions
/.
*-test*
163 mkdir
-p
$(PKG_INSTALL_DIR
)
164 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
165 $(TARGET_CONFIGURE_OPTS
) \
166 CC
=$(TARGET_CC
) COPT_FLAGS
="$(TARGET_CFLAGS)" \
167 KERNEL_DIR
=$(LINUX_DIR
) PREFIX
=/usr \
168 DESTDIR
="$(PKG_INSTALL_DIR)" \
169 all install install-devel
173 define Build
/InstallDev
174 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
175 $(TARGET_CONFIGURE_OPTS
) \
176 CC
=$(TARGET_CC
) COPT_FLAGS
="$(TARGET_CFLAGS)" \
177 KERNEL_DIR
=$(LINUX_DIR
) PREFIX
=/usr \
178 DESTDIR
="$(STAGING_DIR)" \
179 install install-devel
182 define Build
/UninstallDev
183 rm -rf
$(STAGING_DIR
)/usr
/include/libipq.h
184 rm -rf
$(STAGING_DIR
)/usr
/lib
/libipq.a
188 define Package
/iptables
/install
189 install -d
-m0755
$(1)/etc
/config
190 install -m0644 .
/files
/firewall.config
$(1)/etc
/config
/firewall
191 install -d
-m0755
$(1)/etc
/init.d
192 install -m0755 .
/files
/firewall.init
$(1)/etc
/init.d
/S45firewall
193 install -m0755 .
/files
/firewall.user
$(1)/etc
/
194 install -d
-m0755
$(1)/usr
/lib
195 install -m0644 .
/files
/firewall.awk
$(1)/usr
/lib
196 install -d
-m0755
$(1)/usr
/sbin
197 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
$(1)/usr
/sbin
/
198 install -d
-m0755
$(1)/usr
/lib
/iptables
199 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
200 $(CP
) $(patsubst %,lib
%.so
,$(IPT_BUILTIN
:xt_
%=ipt_
%)) $(1)/usr
/lib
/iptables
/ \
205 define Package
/iptables-utils
/install
206 install -d
-m0755
$(1)/usr
/sbin
207 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables-
{save
,restore
} $(1)/usr
/sbin
/
211 define Package
/ip6tables
/install
212 install -d
-m0755
$(1)/usr
/sbin
213 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
$(1)/usr
/sbin
/
214 install -d
-m0755
$(1)/usr
/lib
/iptables
215 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
216 $(CP
) libip6t_
*.so
$(1)/usr
/lib
/iptables
/ \
222 define Package
/$(1)/install
223 install -m0755
-d
$$(1)/usr
/lib
/iptables
224 for m in
$$(patsubst xt_
%,ipt_
%,$(2)); do \
225 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
$$(1)/usr
/lib
/iptables
/ ; \
231 $$(eval
$$(call BuildPackage
,$(1)))
234 L7_INSTALL
:=mkdir
-p
$$(1)/etc
/l7-protocols
; \
235 $(CP
) files
/l7
/*.pat
$$(1)/etc
/l7-protocols
/
237 $(eval
$(call BuildPackage
,iptables
))
238 $(eval
$(call BuildPackage
,iptables-utils
))
239 $(eval
$(call BuildPlugin
,iptables-mod-conntrack
,$(IPT_CONNTRACK-m
)))
240 $(eval
$(call BuildPlugin
,iptables-mod-extra
,$(IPT_EXTRA-m
)))
241 $(eval
$(call BuildPlugin
,iptables-mod-filter
,$(IPT_FILTER-m
),$(L7_INSTALL
)))
242 $(eval
$(call BuildPlugin
,iptables-mod-imq
,$(IPT_IMQ-m
)))
243 $(eval
$(call BuildPlugin
,iptables-mod-ipopt
,$(IPT_IPOPT-m
)))
244 $(eval
$(call BuildPlugin
,iptables-mod-ipsec
,$(IPT_IPSEC-m
)))
245 $(eval
$(call BuildPlugin
,iptables-mod-nat
,$(IPT_NAT-m
)))
246 $(eval
$(call BuildPlugin
,iptables-mod-ulog
,$(IPT_ULOG-m
)))
247 $(eval
$(call BuildPackage
,ip6tables
))