2 # Copyright (C) 2013-2016 OpenWrt.org
3 # Copyright (C) 2016 LEDE project
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE_URL
=$(PROJECT_GIT
)/project
/firewall3.git
16 PKG_SOURCE_DATE
:=2022-01-10
17 PKG_SOURCE_VERSION
:=0f16ea5f055722a532d4e68c7ba34ed084b48b37
18 PKG_MIRROR_HASH
:=219478ef95b170b5122030715eac7b3317f2ac4d67e1a936c22a78b10e056123
19 PKG_MAINTAINER
:=Jo-Philipp Wich
<jo@mein.io
>
22 PKG_CONFIG_DEPENDS
:= CONFIG_IPV6
24 include $(INCLUDE_DIR
)/package.mk
25 include $(INCLUDE_DIR
)/cmake.mk
27 define Package
/firewall
30 TITLE
:=OpenWrt C Firewall
31 DEPENDS
:=+libubox
+libubus
+libuci
+libip4tc
+IPV6
:libip6tc
+libxtables
+kmod-ipt-core
+kmod-ipt-conntrack
+IPV6
:kmod-nf-conntrack6
+kmod-ipt-nat
32 PROVIDES
:=uci-firewall
36 define Package
/firewall
/description
37 This package provides a config-compatible C implementation of the UCI firewall.
40 define Package
/firewall
/conffiles
45 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
-flto
46 TARGET_LDFLAGS
+= -Wl
,--gc-sections
-flto
47 CMAKE_OPTIONS
+= $(if
$(CONFIG_IPV6
),,-DDISABLE_IPV6
=1)
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_CONF
) .
/files
/firewall.hotplug
$(1)/etc
/hotplug.d
/iface
/20-firewall
56 $(INSTALL_DIR
) $(1)/etc
/config
/
57 $(INSTALL_CONF
) .
/files
/firewall.config
$(1)/etc
/config
/firewall
58 $(INSTALL_DIR
) $(1)/etc
/
59 $(INSTALL_CONF
) .
/files
/firewall.user
$(1)/etc
/firewall.user
60 $(INSTALL_DIR
) $(1)/usr
/share
/fw3
61 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/helpers.conf
$(1)/usr
/share
/fw3
64 $(eval
$(call BuildPackage
,firewall
))