e224c928030b7aa03433a1bd0a755a55d291fd6b
[openwrt/openwrt.git] / package / network / config / firewall / Makefile
1 #
2 # Copyright (C) 2013-2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=firewall
11 PKG_VERSION:=2014-09-19
12 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=git://nbd.name/firewall3.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=50e97c52e75bdfd325cf20d43b32d294ff84d92f
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
20 PKG_LICENSE:=ISC
21
22 PKG_LICENSE:=ISC
23 PKG_LICENSE_FILES:=
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/cmake.mk
27
28 define Package/firewall
29 SECTION:=net
30 CATEGORY:=Base system
31 TITLE:=OpenWrt C Firewall
32 DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-nat
33 endef
34
35 define Package/firewall/description
36 This package provides a config-compatible C implementation of the UCI firewall.
37 endef
38
39 define Package/firewall/conffiles
40 /etc/config/firewall
41 /etc/firewall.user
42 endef
43
44 define Build/Configure
45 $(foreach file,$(wildcard $(STAGING_DIR)/usr/lib/iptables/libext*.a),$(CP) $(file) $(PKG_BUILD_DIR)/$(notdir $(file));)
46 $(call Build/Configure/Default)
47 endef
48
49 TARGET_CFLAGS += -ffunction-sections -fdata-sections
50 TARGET_LDFLAGS += -Wl,--gc-sections
51 CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DDISABLE_IPV6=1)
52
53 define Package/firewall/install
54 $(INSTALL_DIR) $(1)/sbin
55 $(INSTALL_BIN) $(PKG_BUILD_DIR)/firewall3 $(1)/sbin/fw3
56 $(INSTALL_DIR) $(1)/etc/init.d
57 $(INSTALL_BIN) ./files/firewall.init $(1)/etc/init.d/firewall
58 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
59 $(INSTALL_DATA) ./files/firewall.hotplug $(1)/etc/hotplug.d/iface/20-firewall
60 $(INSTALL_DIR) $(1)/etc/config/
61 $(INSTALL_DATA) ./files/firewall.config $(1)/etc/config/firewall
62 $(INSTALL_DIR) $(1)/etc/
63 $(INSTALL_DATA) ./files/firewall.user $(1)/etc/firewall.user
64 endef
65
66 $(eval $(call BuildPackage,firewall))