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