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