cosmetic fix for iproute2 config
[openwrt.git] / openwrt / package / iptables / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4 include kernelconfig.mk
5
6 PKG_NAME := iptables
7 PKG_VERSION := 1.3.0
8 PKG_RELEASE := 1
9 PKG_MD5SUM := a072c0f09f1b289cb7af56f76407d033
10
11 PKG_SOURCE_SITE := http://www.netfilter.org/files
12 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.bz2
13 PKG_SOURCE_CAT := bzcat
14 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
15
16 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
17
18 PKG_IPT := $(PACKAGE_DIR)/iptables_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
19 PKG_IPT_EXTRA := $(PACKAGE_DIR)/iptables-extra_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
20 PKG_IP6T := $(PACKAGE_DIR)/ip6tables_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
21
22 I_IPT := $(PKG_BUILD_DIR)/ipkg/iptables
23 I_IPT_EXTRA := $(PKG_BUILD_DIR)/ipkg/iptables-extra
24 I_IP6T := $(PKG_BUILD_DIR)/ipkg/ip6tables
25
26 TARGETS := $(PKG_IPT)
27 ifneq ($(BR2_PACKAGE_IPTABLES_EXTRA),)
28 TARGETS += $(PKG_IPT_EXTRA)
29 endif
30 ifneq ($(BR2_PACKAGE_IP6TABLES),)
31 TARGETS += $(PKG_IP6T)
32 endif
33
34 INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/iptables.list
35 ifeq ($(BR2_PACKAGE_IPTABLES_EXTRA),y)
36 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/iptables-extra.list
37 endif
38 ifeq ($(BR2_PACKAGE_IP6TABLES),y)
39 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/ip6tables.list
40 endif
41
42 $(DL_DIR)/$(PKG_SOURCE_FILE):
43 mkdir -p $(DL_DIR)
44 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) $(PKG_MD5SUM) $(PKG_SOURCE_SITE)
45
46 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
47 mkdir -p $(PKG_BUILD_DIR)/modules
48 $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
49 $(PATCH) $(PKG_BUILD_DIR) ./patches
50 touch $(PKG_BUILD_DIR)/.patched
51
52 $(PKG_BUILD_DIR)/iptables: $(PKG_BUILD_DIR)/.patched
53 $(TARGET_CONFIGURE_OPTS) \
54 $(MAKE) -C $(PKG_BUILD_DIR) \
55 KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
56 CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)"
57
58 $(PKG_IPT): $(PKG_BUILD_DIR)/iptables
59 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_IPT) control/iptables.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
60 mkdir -p $(I_IPT)/usr/sbin
61 cp -af $(PKG_BUILD_DIR)/iptables $(I_IPT)/usr/sbin/
62 $(STRIP) $(I_IPT)/usr/sbin/iptables
63 mkdir -p $(I_IPT)/usr/lib/iptables
64 (cd $(PKG_BUILD_DIR)/extensions; \
65 cp $(patsubst %,libipt_%.so,$(ext-y)) $(I_IPT)/usr/lib/iptables)
66 -$(STRIP) $(I_IPT)/usr/lib/iptables/*.so
67 mkdir -p $(PACKAGE_DIR)
68 $(IPKG_BUILD) $(I_IPT) $(PACKAGE_DIR)
69
70 $(IPKG_STATE_DIR)/info/iptables.list: $(PKG_IPT)
71 $(IPKG) install $(PKG_IPT)
72
73 $(PKG_IPT_EXTRA): $(PKG_BUILD_DIR)/iptables
74 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_IPT_EXTRA) control/iptables-extra.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
75 mkdir -p $(I_IPT_EXTRA)/usr/lib/iptables
76 (cd $(PKG_BUILD_DIR)/extensions; \
77 cp $(patsubst %,libipt_%.so,$(ext-m)) $(I_IPT_EXTRA)/usr/lib/iptables)
78 -$(STRIP) $(I_IPT_EXTRA)/usr/lib/iptables/*.so
79 mkdir -p $(PACKAGE_DIR)
80 $(IPKG_BUILD) $(I_IPT_EXTRA) $(PACKAGE_DIR)
81
82 $(IPKG_STATE_DIR)/info/iptables-extra.list: $(PKG_IPT)
83 $(IPKG) install $(PKG_IPT_EXTRA)
84
85 $(PKG_IP6T): $(PKG_BUILD_DIR)/iptables
86 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_IP6T) control/ip6tables.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
87 mkdir -p $(I_IP6T)/usr/sbin
88 cp -af $(PKG_BUILD_DIR)/ip6tables $(I_IP6T)/usr/sbin/
89 $(STRIP) $(I_IP6T)/usr/sbin/ip6tables
90 mkdir -p $(I_IP6T)/usr/lib/iptables
91 (cd $(PKG_BUILD_DIR)/extensions; \
92 cp libip6t_*.so $(I_IP6T)/usr/lib/iptables)
93 -$(STRIP) $(I_IP6T)/usr/lib/iptables/*.so
94 mkdir -p $(PACKAGE_DIR)
95 $(IPKG_BUILD) $(I_IP6T) $(PACKAGE_DIR)
96
97 $(IPKG_STATE_DIR)/info/ip6tables.list: $(PKG_IP6T)
98 $(IPKG) install $(PKG_IP6T)
99
100
101 source: $(DL_DIR)/$(PKG_SOURCE_FILE)
102 prepare: $(PKG_BUILD_DIR)/.patched
103 compile: $(TARGETS)
104 install: $(INSTALL_TARGETS)
105
106 clean:
107 rm -rf $(PKG_BUILD_DIR)
108 rm -f $(PKG_IPT) $(PKG_IPT_EXTRA) $(PKG_IP6T)
This page took 0.045944 seconds and 5 git commands to generate.