3 include $(TOPDIR
)/rules.mk
4 include kernelconfig.mk
9 PKG_MD5SUM
:= a072c0f09f1b289cb7af56f76407d033
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
)
16 PKG_BUILD_DIR
:= $(BUILD_DIR
)/$(PKG_SOURCE_DIR
)
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
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
27 ifneq ($(BR2_PACKAGE_IPTABLES_EXTRA
),)
28 TARGETS
+= $(PKG_IPT_EXTRA
)
30 ifneq ($(BR2_PACKAGE_IP6TABLES
),)
31 TARGETS
+= $(PKG_IP6T
)
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
38 ifeq ($(BR2_PACKAGE_IP6TABLES
),y
)
39 INSTALL_TARGETS
+= $(IPKG_STATE_DIR
)/info/ip6tables.list
42 $(DL_DIR
)/$(PKG_SOURCE_FILE
):
44 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(PKG_SOURCE_FILE
) $(PKG_MD5SUM
) $(PKG_SOURCE_SITE
)
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
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)"
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
)
70 $(IPKG_STATE_DIR
)/info/iptables.list
: $(PKG_IPT
)
71 $(IPKG
) install $(PKG_IPT
)
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
)
82 $(IPKG_STATE_DIR
)/info/iptables-extra.list
: $(PKG_IPT
)
83 $(IPKG
) install $(PKG_IPT_EXTRA
)
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
)
97 $(IPKG_STATE_DIR
)/info/ip6tables.list
: $(PKG_IP6T
)
98 $(IPKG
) install $(PKG_IP6T
)
101 source
: $(DL_DIR
)/$(PKG_SOURCE_FILE
)
102 prepare
: $(PKG_BUILD_DIR
)/.patched
104 install: $(INSTALL_TARGETS
)
107 rm -rf
$(PKG_BUILD_DIR
)
108 rm -f
$(PKG_IPT
) $(PKG_IPT_EXTRA
) $(PKG_IP6T
)