3d59c093710abcb72bf825731e0d25c65ea4c8ee
[openwrt/staging/chunkeey.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-11-29
13 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL=$(LEDE_GIT)/project/firewall3.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=13698aafb52c45817ee7815da3405e620657c8d0
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
20 PKG_MIRROR_MD5SUM:=fd5468488e67b2a67a95228cb2e2efe66a44426748d294ecd9c7806c6bbe0978
21 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
22 PKG_LICENSE:=ISC
23
24 PKG_CONFIG_DEPENDS := CONFIG_IPV6
25
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/cmake.mk
28
29 define Package/firewall
30 SECTION:=net
31 CATEGORY:=Base system
32 TITLE:=OpenWrt C Firewall
33 DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-conntrack +kmod-ipt-nat
34 endef
35
36 define Package/firewall/description
37 This package provides a config-compatible C implementation of the UCI firewall.
38 endef
39
40 define Package/firewall/conffiles
41 /etc/config/firewall
42 /etc/firewall.user
43 endef
44
45 TARGET_CFLAGS += -ffunction-sections -fdata-sections
46 TARGET_LDFLAGS += -Wl,--gc-sections
47 CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DDISABLE_IPV6=1)
48
49 define Package/firewall/install
50 $(INSTALL_DIR) $(1)/sbin
51 $(INSTALL_BIN) $(PKG_BUILD_DIR)/firewall3 $(1)/sbin/fw3
52 $(INSTALL_DIR) $(1)/etc/init.d
53 $(INSTALL_BIN) ./files/firewall.init $(1)/etc/init.d/firewall
54 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
55 $(INSTALL_DATA) ./files/firewall.hotplug $(1)/etc/hotplug.d/iface/20-firewall
56 $(INSTALL_DIR) $(1)/etc/config/
57 $(INSTALL_DATA) ./files/firewall.config $(1)/etc/config/firewall
58 $(INSTALL_DIR) $(1)/etc/
59 $(INSTALL_DATA) ./files/firewall.user $(1)/etc/firewall.user
60 endef
61
62 $(eval $(call BuildPackage,firewall))