source: trunk/package/iptables/Makefile @ 5652

Last change on this file since 5652 was 5652, checked in by pavlov, 10 years ago

install-devel puts this here, kill it too

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