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