3 include $(TOPDIR
)/rules.mk
4 include kernelconfig.mk
9 PKG_MD5SUM
:= c3358a3bd0d7755df0b64a5063db296b
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_UTILS
:= $(PACKAGE_DIR
)/iptables-utils_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
20 PKG_IPT_EXTRA
:= $(PACKAGE_DIR
)/iptables-extra_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
21 PKG_IP6T
:= $(PACKAGE_DIR
)/ip6tables_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
23 I_IPT
:= $(PKG_BUILD_DIR
)/ipkg
/iptables
24 I_IPT_UTILS
:= $(PKG_BUILD_DIR
)/ipkg
/iptables-utils
25 I_IPT_EXTRA
:= $(PKG_BUILD_DIR
)/ipkg
/iptables-extra
26 I_IP6T
:= $(PKG_BUILD_DIR
)/ipkg
/ip6tables
28 TARGETS
:= $(STAGING_DIR
)/libipq
/libipq.a
$(PKG_IPT
)
29 ifneq ($(BR2_PACKAGE_IPTABLES_UTILS
),)
30 TARGETS
+= $(PKG_IPT_UTILS
)
32 ifneq ($(BR2_PACKAGE_IPTABLES_EXTRA
),)
33 TARGETS
+= $(PKG_IPT_EXTRA
)
35 ifneq ($(BR2_PACKAGE_IP6TABLES
),)
36 TARGETS
+= $(PKG_IP6T
)
39 INSTALL_TARGETS
:= $(IPKG_STATE_DIR
)/info/iptables.list
40 ifeq ($(BR2_PACKAGE_IPTABLES_UTILS
),y
)
41 INSTALL_TARGETS
+= $(IPKG_STATE_DIR
)/info/iptables-utils.list
43 ifeq ($(BR2_PACKAGE_IPTABLES_EXTRA
),y
)
44 INSTALL_TARGETS
+= $(IPKG_STATE_DIR
)/info/iptables-extra.list
46 ifeq ($(BR2_PACKAGE_IP6TABLES
),y
)
47 INSTALL_TARGETS
+= $(IPKG_STATE_DIR
)/info/ip6tables.list
50 $(DL_DIR
)/$(PKG_SOURCE_FILE
):
52 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(PKG_SOURCE_FILE
) $(PKG_MD5SUM
) $(PKG_SOURCE_SITE
)
54 $(PKG_BUILD_DIR
)/.patched
: $(DL_DIR
)/$(PKG_SOURCE_FILE
)
55 mkdir
-p
$(PKG_BUILD_DIR
)/modules
56 $(PKG_SOURCE_CAT
) $(DL_DIR
)/$(PKG_SOURCE_FILE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
57 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
58 touch
$(PKG_BUILD_DIR
)/.patched
60 $(PKG_BUILD_DIR
)/iptables
: $(PKG_BUILD_DIR
)/.patched
61 $(TARGET_CONFIGURE_OPTS
) \
62 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
63 KERNEL_DIR
=$(LINUX_DIR
) PREFIX
=/usr \
64 CC
=$(TARGET_CC
) COPT_FLAGS
="$(TARGET_CFLAGS)"
66 $(STAGING_DIR
)/libipq
/libipq.a
: $(PKG_BUILD_DIR
)/iptables
67 $(TARGET_CONFIGURE_OPTS
) \
68 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
69 KERNEL_DIR
=$(LINUX_DIR
) PREFIX
=/usr \
70 CC
=$(TARGET_CC
) COPT_FLAGS
="$(TARGET_CFLAGS)" \
72 cp
-a
$(PKG_BUILD_DIR
)/include/* $(STAGING_DIR
)/include/
73 cp
$(PKG_BUILD_DIR
)/libipq
/libipq.a
$(STAGING_DIR
)/lib
/
74 cp
$(PKG_BUILD_DIR
)/libiptc
/libiptc.a
$(STAGING_DIR
)/lib
/
76 $(PKG_IPT
): $(PKG_BUILD_DIR
)/iptables
77 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_IPT
) control
/iptables.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
78 mkdir
-p
$(I_IPT
)/usr
/sbin
79 cp
-af
$(PKG_BUILD_DIR
)/iptables
$(I_IPT
)/usr
/sbin
/
80 $(STRIP
) $(I_IPT
)/usr
/sbin
/iptables
81 mkdir
-p
$(I_IPT
)/usr
/lib
/iptables
82 (cd
$(PKG_BUILD_DIR
)/extensions
; \
83 cp
$(patsubst %,libipt_
%.so
,$(ext-y
)) $(I_IPT
)/usr
/lib
/iptables
)
84 -$(STRIP
) $(I_IPT
)/usr
/lib
/iptables
/*.so
85 mkdir
-p
$(PACKAGE_DIR
)
86 $(IPKG_BUILD
) $(I_IPT
) $(PACKAGE_DIR
)
88 $(IPKG_STATE_DIR
)/info/iptables.list
: $(PKG_IPT
)
89 $(IPKG
) install $(PKG_IPT
)
91 $(PKG_IPT_EXTRA
): $(PKG_BUILD_DIR
)/iptables
92 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_IPT_EXTRA
) control
/iptables-extra.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
93 mkdir
-p
$(I_IPT_EXTRA
)/usr
/lib
/iptables
94 (cd
$(PKG_BUILD_DIR
)/extensions
; \
95 cp
$(patsubst %,libipt_
%.so
,$(ext-m
)) $(I_IPT_EXTRA
)/usr
/lib
/iptables
)
96 -$(STRIP
) $(I_IPT_EXTRA
)/usr
/lib
/iptables
/*.so
97 mkdir
-p
$(PACKAGE_DIR
)
98 $(IPKG_BUILD
) $(I_IPT_EXTRA
) $(PACKAGE_DIR
)
100 $(IPKG_STATE_DIR
)/info/iptables-extra.list
: $(PKG_IPT
)
101 $(IPKG
) install $(PKG_IPT_EXTRA
)
103 $(PKG_IPT_UTILS
): $(PKG_BUILD_DIR
)/iptables
104 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_IPT_UTILS
) control
/iptables-utils.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
105 mkdir
-p
$(I_IPT_UTILS
)/usr
/sbin
106 cp
$(PKG_BUILD_DIR
)/iptables-save
$(I_IPT_UTILS
)/usr
/sbin
107 cp
$(PKG_BUILD_DIR
)/iptables-restore
$(I_IPT_UTILS
)/usr
/sbin
108 -$(STRIP
) $(I_IPT_UTILS
)/usr
/sbin
/*
109 mkdir
-p
$(PACKAGE_DIR
)
110 $(IPKG_BUILD
) $(I_IPT_UTILS
) $(PACKAGE_DIR
)
112 $(IPKG_STATE_DIR
)/info/iptables-utils.list
: $(PKG_IPT
)
113 $(IPKG
) install $(PKG_IPT_UTILS
)
115 $(PKG_IP6T
): $(PKG_BUILD_DIR
)/iptables
116 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_IP6T
) control
/ip6tables.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
117 mkdir
-p
$(I_IP6T
)/usr
/sbin
118 cp
-af
$(PKG_BUILD_DIR
)/ip6tables
$(I_IP6T
)/usr
/sbin
/
119 $(STRIP
) $(I_IP6T
)/usr
/sbin
/ip6tables
120 mkdir
-p
$(I_IP6T
)/usr
/lib
/iptables
121 (cd
$(PKG_BUILD_DIR
)/extensions
; \
122 cp libip6t_
*.so
$(I_IP6T
)/usr
/lib
/iptables
)
123 -$(STRIP
) $(I_IP6T
)/usr
/lib
/iptables
/*.so
124 mkdir
-p
$(PACKAGE_DIR
)
125 $(IPKG_BUILD
) $(I_IP6T
) $(PACKAGE_DIR
)
127 $(IPKG_STATE_DIR
)/info/ip6tables.list
: $(PKG_IP6T
)
128 $(IPKG
) install $(PKG_IP6T
)
131 source
: $(DL_DIR
)/$(PKG_SOURCE_FILE
)
132 prepare
: $(PKG_BUILD_DIR
)/.patched
134 install: $(INSTALL_TARGETS
)
137 rm -rf
$(PKG_BUILD_DIR
)
138 rm -f
$(PKG_IPT
) $(PKG_IPT_EXTRA
) $(PKG_IP6T
)