finally move buildroot-ng to trunk
[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.5
14 PKG_RELEASE:=1
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:=00fb916fa8040ca992a5ace56d905ea5
22 PKG_CAT:=bzcat
23
24 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
25 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
26
27 include $(INCLUDE_DIR)/package.mk
28 ifeq ($(DUMP),)
29 -include $(LINUX_DIR)/.config
30 include $(INCLUDE_DIR)/netfilter.mk
31 endif
32
33 define Package/iptables/Default
34 SECTION:=net
35 CATEGORY:=Base system
36 URL:=http://netfilter.org/
37 endef
38
39 define Package/iptables
40 $(call Package/iptables/Default)
41 DEFAULT:=y
42 TITLE:=IPv4 firewall administration tool
43 MENU:=1
44 endef
45
46 define Package/iptables/conffiles
47 /etc/config/firewall
48 /etc/firewall.user
49 endef
50
51 define Package/iptables-mod-conntrack
52 $(call Package/iptables/Default)
53 DEPENDS:=iptables +kmod-ipt-conntrack
54 TITLE:=connection tracking modules
55 DESCRIPTION:=\
56 iptables extensions for connection tracking.\\\
57 \\\
58 Includes: \\\
59 - libipt_conntrack \\\
60 - libipt_helper \\\
61 - libipt_connmark/CONNMARK
62 endef
63
64 define Package/iptables-mod-filter
65 $(call Package/iptables/Default)
66 DEPENDS:=iptables +kmod-ipt-filter
67 TITLE:=filter modules
68 DESCRIPTION:=\
69 iptables extensions for packet content inspection.\\\
70 \\\
71 Includes: \\\
72 - libipt_ipp2p \\\
73 - libipt_layer7
74 endef
75
76 define Package/iptables-mod-imq
77 $(call Package/iptables/Default)
78 DEPENDS:=iptables
79 TITLE:=IMQ support
80 DESCRIPTION:=\
81 iptables extension for IMQ support.\\\
82 \\\
83 Includes: \\\
84 - libipt_IMQ
85 endef
86
87 define Package/iptables-mod-ipopt
88 $(call Package/iptables/Default)
89 DEPENDS:=iptables +kmod-ipt-ipopt
90 TITLE:=IP/Packet option modules
91 DESCRIPTION:=\
92 iptables extensions for matching/changing IP packet options.\\\
93 \\\
94 Includes: \\\
95 - libipt_dscp/DSCP \\\
96 - libipt_ecn/ECN \\\
97 - libipt_length \\\
98 - libipt_mac \\\
99 - libipt_tos/TOS \\\
100 - libipt_tcpmms \\\
101 - libipt_ttl/TTL \\\
102 - libipt_unclean
103 endef
104
105 define Package/iptables-mod-ipsec
106 $(call Package/iptables/Default)
107 DEPENDS:=iptables +kmod-ipt-ipsec
108 TITLE:=IPSec extensions
109 DESCRIPTION:=\
110 iptables extensions for matching ipsec traffic.\\\
111 \\\
112 Includes: \\\
113 - libipt_ah \\\
114 - libipt_esp
115 endef
116
117 define Package/iptables-mod-nat
118 $(call Package/iptables/Default)
119 DEPENDS:=iptables +kmod-ipt-nat
120 TITLE:=extra NAT targets
121 DESCRIPTION:=\
122 iptables extensions for different NAT targets.\\\
123 \\\
124 Includes: \\\
125 - libipt_REDIRECT
126 endef
127
128 define Package/iptables-mod-ulog
129 $(call Package/iptables/Default)
130 DEPENDS:=iptables +kmod-ipt-ulog
131 TITLE:=user-space packet logging
132 DESCRIPTION:=\
133 iptables extensions for user-space packet logging.\\\
134 \\\
135 Includes: \\\
136 - libipt_ULOG
137 endef
138
139 define Package/iptables-mod-extra
140 $(call Package/iptables/Default)
141 DEPENDS:=iptables +kmod-ipt-extra
142 TITLE:=other extra iptables extensions
143 DESCRIPTION:=\
144 other extra iptables extensions.\\\
145 \\\
146 Includes: \\\
147 - libipt_limit \\\
148 - libipt_owner \\\
149 - libipt_physdev \\\
150 - libipt_pkttype \\\
151 - libipt_recent
152 endef
153
154 define Package/iptables-utils
155 $(call Package/iptables/Default)
156 DEPENDS:=iptables
157 TITLE:=iptables save and restore utilities
158 endef
159
160 define Package/ip6tables
161 $(call Package/iptables/Default)
162 CATEGORY:=Network
163 TITLE:=IPv6 firewall administration tool
164 endef
165
166 define Build/Configure
167 endef
168
169 define Build/Compile
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 KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
176 DESTDIR="$(PKG_INSTALL_DIR)" \
177 all install install-devel
178 endef
179
180 define Build/InstallDev
181 $(MAKE) -C $(PKG_BUILD_DIR) \
182 $(TARGET_CONFIGURE_OPTS) \
183 COPT_FLAGS="$(TARGET_CFLAGS)" \
184 KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
185 DESTDIR="$(STAGING_DIR)" \
186 install install-devel
187 endef
188
189 define Build/UninstallDev
190 rm -rf $(STAGING_DIR)/usr/include/libipq.h
191 rm -rf $(STAGING_DIR)/usr/lib/libipq.a
192 endef
193
194 define Package/iptables/install
195 install -d -m0755 $(1)/etc/config
196 install -m0644 ./files/firewall.config $(1)/etc/config/firewall
197 install -d -m0755 $(1)/etc/init.d
198 install -m0755 ./files/firewall.init $(1)/etc/init.d/S45firewall
199 install -m0755 ./files/firewall.user $(1)/etc/
200 install -d -m0755 $(1)/usr/lib
201 install -m0644 ./files/firewall.awk $(1)/usr/lib
202 install -d -m0755 $(1)/usr/sbin
203 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables $(1)/usr/sbin/
204 install -d -m0755 $(1)/usr/lib/iptables
205 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
206 $(CP) $(patsubst %,lib%.so,$(IPT_BUILTIN:xt_%=ipt_%)) $(1)/usr/lib/iptables/ \
207 )
208 endef
209
210 define Package/iptables-utils/install
211 install -d -m0755 $(1)/usr/sbin
212 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables-{save,restore} $(1)/usr/sbin/
213 endef
214
215 define Package/ip6tables/install
216 install -d -m0755 $(1)/usr/sbin
217 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables $(1)/usr/sbin/
218 install -d -m0755 $(1)/usr/lib/iptables
219 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
220 $(CP) libip6t_*.so $(1)/usr/lib/iptables/ \
221 )
222 endef
223
224 define BuildPlugin
225 define Package/$(1)/install
226 install -m0755 -d $$(1)/usr/lib/iptables
227 for m in $$(patsubst xt_%,ipt_%,$(2)); do \
228 $(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so $$(1)/usr/lib/iptables/ ; \
229 done
230 $(3)
231 endef
232
233 $$(eval $$(call BuildPackage,$(1)))
234 endef
235
236 L7_INSTALL:=mkdir -p $$(1)/etc/l7-protocols; \
237 $(CP) files/l7/*.pat $$(1)/etc/l7-protocols/
238
239 $(eval $(call BuildPackage,iptables))
240 $(eval $(call BuildPackage,iptables-utils))
241 $(eval $(call BuildPlugin,iptables-mod-conntrack,$(IPT_CONNTRACK-m)))
242 $(eval $(call BuildPlugin,iptables-mod-extra,$(IPT_EXTRA-m)))
243 $(eval $(call BuildPlugin,iptables-mod-filter,$(IPT_FILTER-m),$(L7_INSTALL)))
244 $(eval $(call BuildPlugin,iptables-mod-imq,$(IPT_IMQ-m)))
245 $(eval $(call BuildPlugin,iptables-mod-ipopt,$(IPT_IPOPT-m)))
246 $(eval $(call BuildPlugin,iptables-mod-ipsec,$(IPT_IPSEC-m)))
247 $(eval $(call BuildPlugin,iptables-mod-nat,$(IPT_NAT-m)))
248 $(eval $(call BuildPlugin,iptables-mod-ulog,$(IPT_ULOG-m)))
249 $(eval $(call BuildPackage,ip6tables))
This page took 0.058185 seconds and 5 git commands to generate.