update lighttpd to new upstream release (v1.4.8),
[openwrt.git] / package / iptables / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=iptables
6 PKG_VERSION:=1.3.3
7 PKG_RELEASE:=2
8 PKG_MD5SUM:=86d88455520cfdc56fd7ae27897a80a4
9
10 PKG_SOURCE_URL:=http://www.netfilter.org/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 define IPKG_plugin_template
21
22 $$(IPKG_$(1)):
23 install -m0755 -d $$(IDIR_$(1))/usr/lib/iptables
24 for m in $(2); do \
25 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$${m}.so $$(IDIR_$(1))/usr/lib/iptables/ ; \
26 done
27 @[ -z "$(3)" ] || $(MAKE) $(3)
28 $(RSTRIP) $$(IDIR_$(1))
29 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
30
31 endef
32
33 include $(TOPDIR)/package/rules.mk
34 include $(LINUX_DIR)/.config
35 include $(TOPDIR)/target/linux/netfilter.mk
36
37 $(eval $(call PKG_template,IPTABLES,iptables,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
38 $(eval $(call PKG_template,IPTABLES_EXTRA,iptables-extra,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
39 $(eval $(call PKG_template,IPTABLES_UTILS,iptables-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
40 $(eval $(call PKG_template,IP6TABLES,ip6tables,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
41
42 $(eval $(call PKG_template,IPTABLES_MOD_CONNTRACK,iptables-mod-conntrack,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
43 $(eval $(call PKG_template,IPTABLES_MOD_EXTRA,iptables-mod-extra,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
44 $(eval $(call PKG_template,IPTABLES_MOD_FILTER,iptables-mod-filter,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
45 $(eval $(call PKG_template,IPTABLES_MOD_IMQ,iptables-mod-img,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
46 $(eval $(call PKG_template,IPTABLES_MOD_IPOPT,iptables-mod-ipopt,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
47 $(eval $(call PKG_template,IPTABLES_MOD_IPSEC,iptables-mod-ipsec,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
48 $(eval $(call PKG_template,IPTABLES_MOD_NAT,iptables-mod-nat,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
49 $(eval $(call PKG_template,IPTABLES_MOD_ULOG,iptables-mod-ulog,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
50
51 $(eval $(call IPKG_plugin_template,IPTABLES_MOD_CONNTRACK,$(IPKG_IPTABLES_MOD_CONNTRACK-m)))
52 $(eval $(call IPKG_plugin_template,IPTABLES_MOD_EXTRA,$(IPKG_IPTABLES_MOD_EXTRA-m)))
53 $(eval $(call IPKG_plugin_template,IPTABLES_MOD_FILTER,$(IPKG_IPTABLES_MOD_FILTER-m),layer7-install))
54 $(eval $(call IPKG_plugin_template,IPTABLES_MOD_IMQ,$(IPKG_IPTABLES_MOD_IMQ-m)))
55 $(eval $(call IPKG_plugin_template,IPTABLES_MOD_IPOPT,$(IPKG_IPTABLES_MOD_IPOPT-m)))
56 $(eval $(call IPKG_plugin_template,IPTABLES_MOD_IPSEC,$(IPKG_IPTABLES_MOD_IPSEC-m)))
57 $(eval $(call IPKG_plugin_template,IPTABLES_MOD_NAT,$(IPKG_IPTABLES_MOD_NAT-m)))
58 $(eval $(call IPKG_plugin_template,IPTABLES_MOD_ULOG,$(IPKG_IPTABLES_MOD_ULOG-m)))
59
60 $(PKG_BUILD_DIR)/.configured:
61 touch $@
62
63 $(PKG_BUILD_DIR)/.built:
64 chmod a+x $(PKG_BUILD_DIR)/extensions/.*-test*
65 mkdir -p $(PKG_INSTALL_DIR)
66 $(MAKE) -C $(PKG_BUILD_DIR) \
67 $(TARGET_CONFIGURE_OPTS) \
68 CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)" \
69 KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
70 DESTDIR="$(PKG_INSTALL_DIR)" \
71 all install install-devel
72 touch $@
73
74 $(IPKG_IPTABLES):
75 install -d -m0755 $(IDIR_IPTABLES)/usr/sbin
76 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/iptables $(IDIR_IPTABLES)/usr/sbin/
77 install -d -m0755 $(IDIR_IPTABLES)/usr/lib/iptables
78 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
79 cp -fpR $(patsubst %,lib%.so,$(IPKG_IPTABLES-y)) $(IDIR_IPTABLES)/usr/lib/iptables/ \
80 )
81 $(RSTRIP) $(IDIR_IPTABLES)
82 $(IPKG_BUILD) $(IDIR_IPTABLES) $(PACKAGE_DIR)
83
84 $(IPKG_IPTABLES_UTILS):
85 install -d -m0755 $(IDIR_IPTABLES_UTILS)/usr/sbin
86 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/iptables-{save,restore} $(IDIR_IPTABLES_UTILS)/usr/sbin/
87 $(RSTRIP) $(IDIR_IPTABLES_UTILS)
88 $(IPKG_BUILD) $(IDIR_IPTABLES_UTILS) $(PACKAGE_DIR)
89
90 $(IPKG_IP6TABLES):
91 install -d -m0755 $(IDIR_IP6TABLES)/usr/sbin
92 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ip6tables $(IDIR_IP6TABLES)/usr/sbin/
93 install -d -m0755 $(IDIR_IP6TABLES)/usr/lib/iptables
94 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
95 cp -fpR libip6t_*.so $(IDIR_IP6TABLES)/usr/lib/iptables/ \
96 )
97 $(RSTRIP) $(IDIR_IP6TABLES)
98 $(IPKG_BUILD) $(IDIR_IP6TABLES) $(PACKAGE_DIR)
99
100 $(STAGING_DIR)/usr/lib/libipq.a: $(PKG_BUILD_DIR)/.built
101 mkdir -p $(STAGING_DIR)/usr/include
102 cp -fpR $(PKG_INSTALL_DIR)/usr/include/libipq.h $(STAGING_DIR)/usr/include/
103 mkdir -p $(STAGING_DIR)/usr/lib
104 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libipq.a $(STAGING_DIR)/usr/lib/
105
106 layer7-install:
107 mkdir -p $(IDIR_IPTABLES_MOD_FILTER)/etc/l7-protocols
108 cp files/l7/*.pat $(IDIR_IPTABLES_MOD_FILTER)/etc/l7-protocols/
109
110 install-dev: $(STAGING_DIR)/usr/lib/libipq.a
111
112 uninstall-dev:
113 rm -rf $(STAGING_DIR)/usr/include/libipq.h
114 rm -rf $(STAGING_DIR)/usr/lib/libipq.a
115
116 compile-targets: install-dev
117 clean-targets: uninstall-dev
This page took 0.043805 seconds and 5 git commands to generate.