source: freewrt/package/iptables/Makefile@ 33408c6

freewrt_1_0 freewrt_2_0
Last change on this file since 33408c6 was d419478, checked in by Thorsten Glaser <tg@…>, 19 years ago
  • whitespace cleanup, while here
  • move WRKDIR and DISTFILES definition into PKG_template
  • define WRKDIR via parent BUILD_DIR instead of going up from WRKSRC
  • use a sub-directory as WRKDIR, like BSD
  • rename PKG_BUILD_DIR into WRKBUILD
  • define WRKBUILD relative via WRKDIR
  • rename PKG_INSTALL_DIR into WRKINST
  • fix a few dependencies
  • make use of common cases in the definition of WRKBUILD and WRKINST, removing many redundant lines
  • use WRKDIR instead of BUILD_DIR in places where the latter was used previously
  • while here, remove PKG_CAT stuff

this only affects packages, for now

git-svn-id: svn://www.freewrt.org/trunk/freewrt@303 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 4.7 KB
Line 
1# $Id: Makefile 3713 2006-04-29 21:43:26Z nbd $
2
3include $(TOPDIR)/rules.mk
4
5PKG_NAME:=iptables
6PKG_VERSION:=1.3.5
7PKG_RELEASE:=1
8PKG_MD5SUM:=00fb916fa8040ca992a5ace56d905ea5
9
10PKG_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/
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15
16
17define IPKG_plugin_template
18
19$$(IPKG_$(1)):
20 install -m0755 -d $$(IDIR_$(1))/usr/lib/iptables
21 for m in $$(patsubst xt_%,ipt_%,$(2)); do \
22 $(CP) $(WRKINST)/usr/lib/iptables/lib$$$${m}.so $$(IDIR_$(1))/usr/lib/iptables/ ; \
23 done
24 @[ -z "$(3)" ] || $(MAKE) $(3)
25 $(RSTRIP) $$(IDIR_$(1))
26 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
27
28endef
29
30include $(TOPDIR)/package/rules.mk
31include $(LINUX_DIR)/.config
32include $(TOPDIR)/target/linux/netfilter.mk
33
34$(eval $(call PKG_template,IPTABLES,iptables,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
35$(eval $(call PKG_template,IPTABLES_EXTRA,iptables-extra,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
36$(eval $(call PKG_template,IPTABLES_UTILS,iptables-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
37$(eval $(call PKG_template,IP6TABLES,ip6tables,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
38
39$(eval $(call PKG_template,IPTABLES_MOD_CONNTRACK,iptables-mod-conntrack,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
40$(eval $(call PKG_template,IPTABLES_MOD_EXTRA,iptables-mod-extra,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
41$(eval $(call PKG_template,IPTABLES_MOD_FILTER,iptables-mod-filter,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
42$(eval $(call PKG_template,IPTABLES_MOD_IMQ,iptables-mod-imq,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
43$(eval $(call PKG_template,IPTABLES_MOD_IPOPT,iptables-mod-ipopt,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
44$(eval $(call PKG_template,IPTABLES_MOD_IPSEC,iptables-mod-ipsec,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
45$(eval $(call PKG_template,IPTABLES_MOD_NAT,iptables-mod-nat,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
46$(eval $(call PKG_template,IPTABLES_MOD_ULOG,iptables-mod-ulog,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
47
48$(eval $(call IPKG_plugin_template,IPTABLES_MOD_CONNTRACK,$(IPT_CONNTRACK-m)))
49$(eval $(call IPKG_plugin_template,IPTABLES_MOD_EXTRA,$(IPT_EXTRA-m)))
50$(eval $(call IPKG_plugin_template,IPTABLES_MOD_FILTER,$(IPT_FILTER-m),layer7-install))
51$(eval $(call IPKG_plugin_template,IPTABLES_MOD_IMQ,$(IPT_IMQ-m)))
52$(eval $(call IPKG_plugin_template,IPTABLES_MOD_IPOPT,$(IPT_IPOPT-m)))
53$(eval $(call IPKG_plugin_template,IPTABLES_MOD_IPSEC,$(IPT_IPSEC-m)))
54$(eval $(call IPKG_plugin_template,IPTABLES_MOD_NAT,$(IPT_NAT-m)))
55$(eval $(call IPKG_plugin_template,IPTABLES_MOD_ULOG,$(IPT_ULOG-m)))
56
57$(WRKBUILD)/.configured:
58 touch $@
59
60$(WRKBUILD)/.built:
61 chmod a+x $(WRKBUILD)/extensions/.*-test*
62 mkdir -p $(WRKINST)
63 $(MAKE) -C $(WRKBUILD) \
64 $(TARGET_CONFIGURE_OPTS) \
65 CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)" \
66 KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
67 DESTDIR="$(WRKINST)" \
68 all install install-devel
69 touch $@
70
71$(IPKG_IPTABLES):
72 install -d -m0755 $(IDIR_IPTABLES)/etc/init.d
73 install -m0755 ./files/firewall.init $(IDIR_IPTABLES)/etc/init.d/S45firewall
74 install -d -m0755 $(IDIR_IPTABLES)/usr/sbin
75 $(CP) $(WRKINST)/usr/sbin/iptables $(IDIR_IPTABLES)/usr/sbin/
76 install -d -m0755 $(IDIR_IPTABLES)/usr/lib/iptables
77 (cd $(WRKINST)/usr/lib/iptables ; \
78 $(CP) $(patsubst %,lib%.so,$(IPT_BUILTIN:xt_%=ipt_%)) $(IDIR_IPTABLES)/usr/lib/iptables/ \
79 )
80 $(RSTRIP) $(IDIR_IPTABLES)
81 $(IPKG_BUILD) $(IDIR_IPTABLES) $(PACKAGE_DIR)
82
83$(IPKG_IPTABLES_EXTRA):
84 $(IPKG_BUILD) $(IDIR_IPTABLES_EXTRA) $(PACKAGE_DIR)
85
86$(IPKG_IPTABLES_UTILS):
87 install -d -m0755 $(IDIR_IPTABLES_UTILS)/usr/sbin
88 $(CP) $(WRKINST)/usr/sbin/iptables-{save,restore} $(IDIR_IPTABLES_UTILS)/usr/sbin/
89 $(RSTRIP) $(IDIR_IPTABLES_UTILS)
90 $(IPKG_BUILD) $(IDIR_IPTABLES_UTILS) $(PACKAGE_DIR)
91
92$(IPKG_IP6TABLES):
93 install -d -m0755 $(IDIR_IP6TABLES)/usr/sbin
94 $(CP) $(WRKINST)/usr/sbin/ip6tables $(IDIR_IP6TABLES)/usr/sbin/
95 install -d -m0755 $(IDIR_IP6TABLES)/usr/lib/iptables
96 (cd $(WRKINST)/usr/lib/iptables ; \
97 $(CP) libip6t_*.so $(IDIR_IP6TABLES)/usr/lib/iptables/ \
98 )
99 $(RSTRIP) $(IDIR_IP6TABLES)
100 $(IPKG_BUILD) $(IDIR_IP6TABLES) $(PACKAGE_DIR)
101
102$(STAGING_DIR)/usr/lib/libipq.a: $(WRKBUILD)/.built
103 $(MAKE) -C $(WRKBUILD) \
104 $(TARGET_CONFIGURE_OPTS) \
105 CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)" \
106 KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
107 DESTDIR="$(STAGING_DIR)" \
108 install install-devel
109
110layer7-install:
111 mkdir -p $(IDIR_IPTABLES_MOD_FILTER)/etc/l7-protocols
112 $(CP) files/l7/*.pat $(IDIR_IPTABLES_MOD_FILTER)/etc/l7-protocols/
113
114install-dev: $(STAGING_DIR)/usr/lib/libipq.a
115
116uninstall-dev:
117 rm -rf $(STAGING_DIR)/usr/include/libipq.h
118 rm -rf $(STAGING_DIR)/usr/lib/libipq.a
119
120compile-targets: install-dev
121clean-targets: uninstall-dev
Note: See TracBrowser for help on using the repository browser.