ffce0c37bfa0bd12f974a221c81dbc74370ef201
[openwrt/staging/yousong.git] / package / network / config / firewall / Makefile
1 #
2 # Copyright (C) 2013-2016 OpenWrt.org
3 # Copyright (C) 2016 LEDE project
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=firewall
12 PKG_VERSION:=2016-05-02
13 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL=$(OPENWRT_GIT)/project/firewall3.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=6cccf1ba7f0c3eb34ef4a7adc6af501376bfa875
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
20 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
21 PKG_LICENSE:=ISC
22
23 PKG_CONFIG_DEPENDS := CONFIG_IPV6
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-conntrack +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 TARGET_CFLAGS += -ffunction-sections -fdata-sections
45 TARGET_LDFLAGS += -Wl,--gc-sections
46 CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DDISABLE_IPV6=1)
47
48 define Package/firewall/install
49 $(INSTALL_DIR) $(1)/sbin
50 $(INSTALL_BIN) $(PKG_BUILD_DIR)/firewall3 $(1)/sbin/fw3
51 $(INSTALL_DIR) $(1)/etc/init.d
52 $(INSTALL_BIN) ./files/firewall.init $(1)/etc/init.d/firewall
53 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
54 $(INSTALL_DATA) ./files/firewall.hotplug $(1)/etc/hotplug.d/iface/20-firewall
55 $(INSTALL_DIR) $(1)/etc/config/
56 $(INSTALL_DATA) ./files/firewall.config $(1)/etc/config/firewall
57 $(INSTALL_DIR) $(1)/etc/
58 $(INSTALL_DATA) ./files/firewall.user $(1)/etc/firewall.user
59 endef
60
61 $(eval $(call BuildPackage,firewall))