uci firewall
[openwrt-10.03/.git] / package / firewall / Makefile
1 #
2 # Copyright (C) 2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=firewall
10
11 PKG_VERSION:=1
12 PKG_RELEASE:=1
13
14 include $(INCLUDE_DIR)/package.mk
15
16 define Package/firewall
17   SECTION:=net
18   CATEGORY:=Base system
19   URL:=http://openwrt.org/
20   TITLE:=OpenWrt firewall
21   DEPENDS:=+iptables
22 endef
23
24 define Package/firewall/description
25  firewall for openwrt, you can select if you want to use the old version or the new uci based script
26 endef
27
28 define Package/firewall/config
29         source "$(SOURCE)/Config.in"
30 endef
31
32 define Build/Compile
33         true
34 endef
35
36 ifeq ($(CONFIG_FIREWALL_NEW),y)
37 define Package/firewall/conffiles
38 /etc/config/firewall
39 endef
40
41 define Package/firewall/install
42         $(INSTALL_DIR) $(1)/lib/firewall
43         $(INSTALL_DATA) ./files/new/uci_firewall.sh $(1)/lib/firewall
44         $(INSTALL_DIR) $(1)/etc/config
45         $(INSTALL_DATA) ./files/new/firewall.config $(1)/etc/config/firewall
46         $(INSTALL_DIR) $(1)/etc/init.d/
47         $(INSTALL_BIN) ./files/new/firewall.init $(1)/etc/init.d/firewall
48         $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
49         $(INSTALL_DATA) ./files/new/20-firewall $(1)/etc/hotplug.d/iface
50 endef
51
52 else
53
54 define Package/firewall/conffiles
55 /etc/firewall.config
56 /etc/firewall.user
57 endef
58
59 define Package/firewall/install
60         $(INSTALL_DIR) $(1)/etc/config
61         $(INSTALL_DATA) ./files/old/firewall.config $(1)/etc/
62         $(INSTALL_DIR) $(1)/etc/init.d
63         $(INSTALL_BIN) ./files/old/firewall.init $(1)/etc/init.d/firewall
64         $(INSTALL_BIN) ./files/old/firewall.user $(1)/etc/
65         $(INSTALL_DIR) $(1)/usr/lib
66         $(INSTALL_DATA) ./files/old/firewall.awk $(1)/usr/lib
67 endef
68 endif
69 $(eval $(call BuildPackage,firewall))