source: freewrt/package/iptables/Makefile@ e4ba301

freewrt_1_0 freewrt_2_0
Last change on this file since e4ba301 was 141418f, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago
  • remove some obsolete firewall config stuff
  • add old-style network configuration based on nvram
  • add new rc.conf file to configure which services should be started on startup, bsd-ish behavior
  • disable firewall by default in rc.conf, remote update via ssh is now possible. port 22 is open by default on wan side
  • enable suid bit on busybox and add a "admin" user
  • ssh via root is disabled (dropbear -w)
  • default password for "admin" is "FreeWRT", as well as for root please change directly after installation
  • remove telnetd from startup, will be used only for failsafe

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

  • Property mode set to 100644
File size: 4.9 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
15PKG_CAT:=bzcat
16
17PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
18PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
19
20define IPKG_plugin_template
21
22$$(IPKG_$(1)):
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/ ; \
26 done
27 @[ -z "$(3)" ] || $(MAKE) $(3)
28 $(RSTRIP) $$(IDIR_$(1))
29 $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
30
31endef
32
33include $(TOPDIR)/package/rules.mk
34include $(LINUX_DIR)/.config
35include $(TOPDIR)/target/linux/netfilter.mk
36
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)))
41
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)))
50
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)))
59
60$(PKG_BUILD_DIR)/.configured:
61 touch $@
62
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
72 touch $@
73
74$(IPKG_IPTABLES):
75 install -d -m0755 $(IDIR_IPTABLES)/etc/init.d
76 install -m0755 ./files/firewall.init $(IDIR_IPTABLES)/etc/init.d/S45firewall
77 install -d -m0755 $(IDIR_IPTABLES)/usr/sbin
78 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables $(IDIR_IPTABLES)/usr/sbin/
79 install -d -m0755 $(IDIR_IPTABLES)/usr/lib/iptables
80 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
81 $(CP) $(patsubst %,lib%.so,$(IPT_BUILTIN:xt_%=ipt_%)) $(IDIR_IPTABLES)/usr/lib/iptables/ \
82 )
83 $(RSTRIP) $(IDIR_IPTABLES)
84 $(IPKG_BUILD) $(IDIR_IPTABLES) $(PACKAGE_DIR)
85
86$(IPKG_IPTABLES_EXTRA):
87 $(IPKG_BUILD) $(IDIR_IPTABLES_EXTRA) $(PACKAGE_DIR)
88
89$(IPKG_IPTABLES_UTILS):
90 install -d -m0755 $(IDIR_IPTABLES_UTILS)/usr/sbin
91 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/iptables-{save,restore} $(IDIR_IPTABLES_UTILS)/usr/sbin/
92 $(RSTRIP) $(IDIR_IPTABLES_UTILS)
93 $(IPKG_BUILD) $(IDIR_IPTABLES_UTILS) $(PACKAGE_DIR)
94
95$(IPKG_IP6TABLES):
96 install -d -m0755 $(IDIR_IP6TABLES)/usr/sbin
97 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables $(IDIR_IP6TABLES)/usr/sbin/
98 install -d -m0755 $(IDIR_IP6TABLES)/usr/lib/iptables
99 (cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
100 $(CP) libip6t_*.so $(IDIR_IP6TABLES)/usr/lib/iptables/ \
101 )
102 $(RSTRIP) $(IDIR_IP6TABLES)
103 $(IPKG_BUILD) $(IDIR_IP6TABLES) $(PACKAGE_DIR)
104
105$(STAGING_DIR)/usr/lib/libipq.a: $(PKG_BUILD_DIR)/.built
106 $(MAKE) -C $(PKG_BUILD_DIR) \
107 $(TARGET_CONFIGURE_OPTS) \
108 CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)" \
109 KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
110 DESTDIR="$(STAGING_DIR)" \
111 install install-devel
112
113layer7-install:
114 mkdir -p $(IDIR_IPTABLES_MOD_FILTER)/etc/l7-protocols
115 $(CP) files/l7/*.pat $(IDIR_IPTABLES_MOD_FILTER)/etc/l7-protocols/
116
117install-dev: $(STAGING_DIR)/usr/lib/libipq.a
118
119uninstall-dev:
120 rm -rf $(STAGING_DIR)/usr/include/libipq.h
121 rm -rf $(STAGING_DIR)/usr/lib/libipq.a
122
123compile-targets: install-dev
124clean-targets: uninstall-dev
Note: See TracBrowser for help on using the repository browser.