treewide: add support for "gc-sections" in PKG_BUILD_FLAGS
[openwrt/staging/jow.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_RELEASE:=3
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git
16 PKG_SOURCE_DATE:=2022-02-17
17 PKG_SOURCE_VERSION:=4cd7d4f36bea731bf901cb067456f1d460294926
18 PKG_MIRROR_HASH:=ce9e8ac1bcf22afbb0a80c3da1a8e8e887851299681097e3dfbfc347f2c4c80f
19 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
20 PKG_LICENSE:=ISC
21
22 PKG_CONFIG_DEPENDS := CONFIG_IPV6
23
24 PKG_BUILD_FLAGS:=gc-sections
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 +libiptext +IPV6:libiptext6 +libxtables +kmod-ipt-core +kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +kmod-ipt-nat
34 PROVIDES:=uci-firewall
35 CONFLICTS:=firewall4
36 endef
37
38 define Package/firewall/description
39 This package provides a config-compatible C implementation of the UCI firewall.
40 endef
41
42 define Package/firewall/conffiles
43 /etc/config/firewall
44 /etc/firewall.user
45 endef
46
47 TARGET_CFLAGS += -flto
48 TARGET_LDFLAGS += -flto
49 CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DDISABLE_IPV6=1)
50
51 define Package/firewall/install
52 $(INSTALL_DIR) $(1)/sbin
53 $(INSTALL_BIN) $(PKG_BUILD_DIR)/firewall3 $(1)/sbin/fw3
54 $(INSTALL_DIR) $(1)/etc/init.d
55 $(INSTALL_BIN) ./files/firewall.init $(1)/etc/init.d/firewall
56 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
57 $(INSTALL_CONF) ./files/firewall.hotplug $(1)/etc/hotplug.d/iface/20-firewall
58 $(INSTALL_DIR) $(1)/etc/config/
59 $(INSTALL_CONF) ./files/firewall.config $(1)/etc/config/firewall
60 $(INSTALL_DIR) $(1)/etc/
61 $(INSTALL_CONF) ./files/firewall.user $(1)/etc/firewall.user
62 $(INSTALL_DIR) $(1)/usr/share/fw3
63 $(INSTALL_CONF) $(PKG_BUILD_DIR)/helpers.conf $(1)/usr/share/fw3
64 endef
65
66 $(eval $(call BuildPackage,firewall))