3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=00fb916fa8040ca992a5ace56d905ea5
10 PKG_SOURCE_URL
:=http
://www.netfilter.org
/projects
/iptables
/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
17 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
18 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
20 define IPKG_plugin_template
23 install -m0755
-d
$$(IDIR_
$(1))/usr
/lib
/iptables
24 for m in
$$(patsubst xt_
%,ipt_
%,$(2)); do \
25 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$${m}.so
$$(IDIR_
$(1))/usr
/lib
/iptables
/ ; \
27 @
[ -z
"$(3)" ] ||
$(MAKE
) $(3)
28 $(RSTRIP
) $$(IDIR_
$(1))
29 $(IPKG_BUILD
) $$(IDIR_
$(1)) $(PACKAGE_DIR
)
33 include $(TOPDIR
)/package
/rules.mk
34 include $(LINUX_DIR
)/.config
35 include $(TOPDIR
)/target
/linux
/netfilter.mk
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
)))
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-imq
,$(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
)))
51 $(eval
$(call IPKG_plugin_template
,IPTABLES_MOD_CONNTRACK
,$(IPT_CONNTRACK-m
)))
52 $(eval
$(call IPKG_plugin_template
,IPTABLES_MOD_EXTRA
,$(IPT_EXTRA-m
)))
53 $(eval
$(call IPKG_plugin_template
,IPTABLES_MOD_FILTER
,$(IPT_FILTER-m
),layer7-install
))
54 $(eval
$(call IPKG_plugin_template
,IPTABLES_MOD_IMQ
,$(IPT_IMQ-m
)))
55 $(eval
$(call IPKG_plugin_template
,IPTABLES_MOD_IPOPT
,$(IPT_IPOPT-m
)))
56 $(eval
$(call IPKG_plugin_template
,IPTABLES_MOD_IPSEC
,$(IPT_IPSEC-m
)))
57 $(eval
$(call IPKG_plugin_template
,IPTABLES_MOD_NAT
,$(IPT_NAT-m
)))
58 $(eval
$(call IPKG_plugin_template
,IPTABLES_MOD_ULOG
,$(IPT_ULOG-m
)))
60 $(PKG_BUILD_DIR
)/.configured
:
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
75 install -d
-m0755
$(IDIR_IPTABLES
)/etc
/config
76 install -m0644 .
/files
/firewall.config
$(IDIR_IPTABLES
)/etc
/config
/firewall
77 install -d
-m0755
$(IDIR_IPTABLES
)/etc
/init.d
78 install -m0755 .
/files
/firewall.init
$(IDIR_IPTABLES
)/etc
/init.d
/S45firewall
79 install -m0755 .
/files
/firewall.user
$(IDIR_IPTABLES
)/etc
/
80 install -d
-m0755
$(IDIR_IPTABLES
)/usr
/lib
81 install -m0644 .
/files
/firewall.awk
$(IDIR_IPTABLES
)/usr
/lib
82 install -d
-m0755
$(IDIR_IPTABLES
)/usr
/sbin
83 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
$(IDIR_IPTABLES
)/usr
/sbin
/
84 install -d
-m0755
$(IDIR_IPTABLES
)/usr
/lib
/iptables
85 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
86 $(CP
) $(patsubst %,lib
%.so
,$(IPT_BUILTIN
:xt_
%=ipt_
%)) $(IDIR_IPTABLES
)/usr
/lib
/iptables
/ \
88 $(RSTRIP
) $(IDIR_IPTABLES
)
89 $(IPKG_BUILD
) $(IDIR_IPTABLES
) $(PACKAGE_DIR
)
91 $(IPKG_IPTABLES_EXTRA
):
92 $(IPKG_BUILD
) $(IDIR_IPTABLES_EXTRA
) $(PACKAGE_DIR
)
94 $(IPKG_IPTABLES_UTILS
):
95 install -d
-m0755
$(IDIR_IPTABLES_UTILS
)/usr
/sbin
96 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables-
{save
,restore
} $(IDIR_IPTABLES_UTILS
)/usr
/sbin
/
97 $(RSTRIP
) $(IDIR_IPTABLES_UTILS
)
98 $(IPKG_BUILD
) $(IDIR_IPTABLES_UTILS
) $(PACKAGE_DIR
)
101 install -d
-m0755
$(IDIR_IP6TABLES
)/usr
/sbin
102 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
$(IDIR_IP6TABLES
)/usr
/sbin
/
103 install -d
-m0755
$(IDIR_IP6TABLES
)/usr
/lib
/iptables
104 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
105 $(CP
) libip6t_
*.so
$(IDIR_IP6TABLES
)/usr
/lib
/iptables
/ \
107 $(RSTRIP
) $(IDIR_IP6TABLES
)
108 $(IPKG_BUILD
) $(IDIR_IP6TABLES
) $(PACKAGE_DIR
)
110 $(STAGING_DIR
)/usr
/lib
/libipq.a
: $(PKG_BUILD_DIR
)/.built
111 mkdir
-p
$(STAGING_DIR
)/usr
/include
112 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/libipq.h
$(STAGING_DIR
)/usr
/include/
113 mkdir
-p
$(STAGING_DIR
)/usr
/lib
114 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libipq.a
$(STAGING_DIR
)/usr
/lib
/
117 mkdir
-p
$(IDIR_IPTABLES_MOD_FILTER
)/etc
/l7-protocols
118 $(CP
) files
/l7
/*.pat
$(IDIR_IPTABLES_MOD_FILTER
)/etc
/l7-protocols
/
120 install-dev
: $(STAGING_DIR
)/usr
/lib
/libipq.a
123 rm -rf
$(STAGING_DIR
)/usr
/include/libipq.h
124 rm -rf
$(STAGING_DIR
)/usr
/lib
/libipq.a
126 compile-targets
: install-dev
127 clean-targets
: uninstall-dev