madwifi: don't poll the channel noise in a performance critical path
[openwrt.git] / package / iptables / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=iptables
13 PKG_VERSION:=1.3.8
14 PKG_RELEASE:=2
15
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
22
23 include $(INCLUDE_DIR)/package.mk
24 ifeq ($(DUMP),)
25 -include $(LINUX_DIR)/.config
26 include $(INCLUDE_DIR)/netfilter.mk
27 STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep 'NETFILTER' $(LINUX_DIR)/.config | md5s)
28 endif
29
30 define Package/iptables/Default
31 SECTION:=net
32 CATEGORY:=Base system
33 URL:=http://netfilter.org/
34 endef
35
36 define Package/iptables
37 $(call Package/iptables/Default)
38 TITLE:=IPv4 firewall administration tool
39 MENU:=1
40 endef
41
42 define Package/iptables/conffiles
43 /etc/config/firewall
44 /etc/firewall.user
45 endef
46
47 define Package/iptables-mod-conntrack
48 $(call Package/iptables/Default)
49 DEPENDS:=iptables +kmod-ipt-conntrack
50 TITLE:=connection tracking modules
51 endef
52
53 define Package/iptables-mod-conntrack/description
54 iptables extensions for connection tracking.
55 Includes:
56 - libipt_conntrack
57 - libipt_helper
58 - libipt_connmark/CONNMARK
59 endef
60
61 define Package/iptables-mod-filter
62 $(call Package/iptables/Default)
63 DEPENDS:=iptables +kmod-ipt-filter
64 TITLE:=filter modules
65 endef
66
67 define Package/iptables-mod-filter/description
68 iptables extensions for packet content inspection.
69 Includes:
70 - libipt_ipp2p
71 - libipt_layer7
72 endef
73
74 define Package/iptables-mod-imq
75 $(call Package/iptables/Default)
76 DEPENDS:=iptables +kmod-ipt-imq
77 TITLE:=IMQ support
78 endef
79
80 define Package/iptables-mod-imq/description
81 iptables extension for IMQ support.
82 Includes:
83 - libipt_IMQ
84 endef
85
86 define Package/iptables-mod-ipopt
87 $(call Package/iptables/Default)
88 DEPENDS:=iptables +kmod-ipt-ipopt
89 TITLE:=IP/Packet option modules
90 endef
91
92 define Package/iptables-mod-ipopt/description
93 iptables extensions for matching/changing IP packet options.\\\
94 Includes:
95 - libipt_CLASSIFY
96 - libipt_dscp/DSCP
97 - libipt_ecn/ECN
98 - libipt_length
99 - libipt_mac
100 - libipt_tos/TOS
101 - libipt_tcpmms
102 - libipt_ttl/TTL
103 - libipt_unclean
104 endef
105
106 define Package/iptables-mod-ipsec
107 $(call Package/iptables/Default)
108 DEPENDS:=iptables +kmod-ipt-ipsec
109 TITLE:=IPSec extensions
110 endef
111
112 define Package/iptables-mod-ipsec/description
113 iptables extensions for matching ipsec traffic.
114 Includes:
115 - libipt_ah
116 - libipt_esp
117 - libipt_policy
118 endef
119
120 define Package/iptables-mod-nat
121 $(call Package/iptables/Default)
122 DEPENDS:=iptables +kmod-ipt-nat
123 TITLE:=extra NAT targets
124 endef
125
126 define Package/iptables-mod-nat/description
127 iptables extensions for different NAT targets.
128 Includes:
129 - libipt_REDIRECT
130 endef
131
132 define Package/iptables-mod-ulog
133 $(call Package/iptables/Default)
134 DEPENDS:=iptables +kmod-ipt-ulog
135 TITLE:=user-space packet logging
136 endef
137
138 define Package/iptables-mod-ulog/description
139 iptables extensions for user-space packet logging.
140 Includes:
141 - libipt_ULOG
142 endef
143
144 define Package/iptables-mod-iprange
145 $(call Package/iptables/Default)
146 DEPENDS:=iptables +kmod-ipt-iprange
147 TITLE:=ip range module
148 endef
149
150 define Package/iptables-mod-iprange/description
151 iptables extensions for matching ip ranges.
152 Includes:
153 - libipt_iprange
154 endef
155
156 define Package/iptables-mod-extra
157 $(call Package/iptables/Default)
158 DEPENDS:=iptables +kmod-ipt-extra
159 TITLE:=other extra iptables extensions
160 endef
161
162 define Package/iptables-mod-extra/description
163 other extra iptables extensions.
164 Includes:
165 - libipt_limit
166 - libipt_owner
167 - libipt_physdev
168 - libipt_pkttype
169 - libipt_recent
170 - iptable_raw
171 - libipt_NOTRACK
172 - libipt_TARPIT
173 - libipt_DELUDE
174 - libipt_CHAOS
175 endef
176
177 define Package/iptables-mod-ipset
178 $(call Package/iptables/Default)
179 DEPENDS:=iptables +kmod-ipt-ipset
180 TITLE:=ipset iptables extension
181 endef
182
183 define Package/iptables-utils
184 $(call Package/iptables/Default)
185 DEPENDS:=iptables
186 TITLE:=iptables save and restore utilities
187 endef
188
189 define Package/ip6tables
190 $(call Package/iptables/Default)
191 DEPENDS:=+kmod-ipv6
192 CATEGORY:=Network
193 TITLE:=IPv6 firewall administration tool
194 endef
195
196 define Package/ip6tables-utils
197 $(call Package/iptables/Default)
198 DEPENDS:=ip6tables
199 CATEGORY:=Network
200 TITLE:=ip6tables save and restore utilities
201 endef
202
203 define Build/Prepare
204 $(call Build/Prepare/Default)
205 chmod a+x $(PKG_BUILD_DIR)/extensions/.*-test*
206 endef
207
208 define Build/Configure
209 rm -f $(PKG_BUILD_DIR)/.configured*
210 $(MAKE) -C $(PKG_BUILD_DIR) \
211 clean
212 endef
213
214 define Build/Compile
215 mkdir -p $(PKG_INSTALL_DIR)
216 $(MAKE) -C $(PKG_BUILD_DIR) \
217 $(TARGET_CONFIGURE_OPTS) \
218 COPT_FLAGS="$(TARGET_CFLAGS)" \
219 LDFLAGS="-rdynamic -static-libgcc" \
220 KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
221 DESTDIR="$(PKG_INSTALL_DIR)" \
222 all experimental install install-experimental
223 endef
224
225 define Build/InstallDev
226 $(MAKE) -C $(PKG_BUILD_DIR) \
227 $(TARGET_CONFIGURE_OPTS) \
228 COPT_FLAGS="$(TARGET_CFLAGS)" \
229 KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
230 DESTDIR="$(1)" \
231 install-devel
232 $(CP) $(PKG_BUILD_DIR)/include $(1)/usr
233 $(CP) $(PKG_BUILD_DIR)/libiptc/libiptc.a $(1)/usr/lib
234 endef
235
236 define Build/UninstallDev
237 rm -rf $(1)/usr/include/libipq.h
238 rm -rf $(1)/usr/include/libipulog
239 rm -rf $(1)/usr/include/libipq
240 rm -rf $(1)/usr/include/libiptc
241 rm -rf $(1)/usr/include/linux/netfilter*
242 rm -rf $(1)/usr/include/iptables*
243 rm -rf $(1)/usr/include/ip6tables*
244 rm -rf $(1)/usr/lib/libipq.a
245 rm -rf $(1)/usr/lib/libiptc.a
246 endef
247
248 define Package/iptables/install
249 $(INSTALL_DIR) $(1)/etc/config
250 $(INSTALL_DATA) ./files/firewall.config $(1)/etc/config/firewall
251 $(INSTALL_DIR) $(1)/etc/init.d
252 $(INSTALL_BIN) ./files/firewall.init $(1)/etc/init.d/firewall
253 $(INSTALL_BIN) ./files/firewall.user $(1)/etc/
254 $(INSTALL_DIR) $(1)/usr/lib
255 $(INSTALL_DATA) ./files/firewall.awk $(1)/usr/lib
256 $(INSTALL_DIR) $(1)/usr/sbin
257 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables $(1)/usr/sbin/
258 $(INSTALL_DIR) $(1)/usr/lib/iptables
259 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
260 $(CP) $(patsubst %,lib%.so,$(IPT_BUILTIN:xt_%=ipt_%)) $(1)/usr/lib/iptables/ \
261 )
262 endef
263
264 define Package/iptables-utils/install
265 $(INSTALL_DIR) $(1)/usr/sbin
266 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables-{save,restore} $(1)/usr/sbin/
267 endef
268
269 define Package/ip6tables/install
270 $(INSTALL_DIR) $(1)/usr/sbin
271 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables $(1)/usr/sbin/
272 $(INSTALL_DIR) $(1)/usr/lib/iptables
273 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
274 $(CP) libip6t_*.so $(1)/usr/lib/iptables/ \
275 )
276 endef
277
278 define Package/ip6tables-utils/install
279 $(INSTALL_DIR) $(1)/usr/sbin
280 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables-{save,restore} $(1)/usr/sbin/
281 endef
282
283 define BuildPlugin
284 define Package/$(1)/install
285 $(INSTALL_DIR) $$(1)/usr/lib/iptables
286 for m in $$(patsubst xt_%,ipt_%,$(2)); do \
287 $(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so $$(1)/usr/lib/iptables/ ; \
288 done
289 $(3)
290 endef
291
292 $$(eval $$(call BuildPackage,$(1)))
293 endef
294
295 L7_INSTALL:=\
296 $(INSTALL_DIR) $$(1)/etc/l7-protocols; \
297 $(CP) files/l7/*.pat $$(1)/etc/l7-protocols/
298
299 $(eval $(call BuildPackage,iptables))
300 $(eval $(call BuildPackage,iptables-utils))
301 $(eval $(call BuildPlugin,iptables-mod-conntrack,$(IPT_CONNTRACK-m)))
302 $(eval $(call BuildPlugin,iptables-mod-extra,$(IPT_EXTRA-m)))
303 $(eval $(call BuildPlugin,iptables-mod-ipset,$(IPT_IPSET-m)))
304 $(eval $(call BuildPlugin,iptables-mod-filter,$(IPT_FILTER-m),$(L7_INSTALL)))
305 $(eval $(call BuildPlugin,iptables-mod-imq,$(IPT_IMQ-m)))
306 $(eval $(call BuildPlugin,iptables-mod-ipopt,$(IPT_IPOPT-m)))
307 $(eval $(call BuildPlugin,iptables-mod-ipsec,$(IPT_IPSEC-m)))
308 $(eval $(call BuildPlugin,iptables-mod-nat,$(IPT_NAT-m)))
309 $(eval $(call BuildPlugin,iptables-mod-iprange,$(IPT_IPRANGE-m)))
310 $(eval $(call BuildPlugin,iptables-mod-ulog,$(IPT_ULOG-m)))
311 $(eval $(call BuildPackage,ip6tables))
312 $(eval $(call BuildPackage,ip6tables-utils))
This page took 0.060133 seconds and 5 git commands to generate.