2 # Copyright (C) 2013-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
11 PKG_VERSION:=2014-08-11a
12 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
15 PKG_SOURCE_URL:=git://nbd.name/firewall3.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=8205107ffd31a21c1d4d93eaa7a44d41c6c3c10d
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/cmake.mk
25 define Package/firewall
28 TITLE:=OpenWrt C Firewall
29 DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-nat
32 define Package/firewall/description
33 This package provides a config-compatible C implementation of the UCI firewall.
36 define Package/firewall/conffiles
41 define Build/Configure
42 $(foreach file,$(wildcard $(STAGING_DIR)/usr/lib/iptables/libext*.a),$(CP) $(file) $(PKG_BUILD_DIR)/$(notdir $(file));)
43 $(call Build/Configure/Default)
46 TARGET_CFLAGS += -ffunction-sections -fdata-sections
47 TARGET_LDFLAGS += -Wl,--gc-sections
48 CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DDISABLE_IPV6=1)
50 define Package/firewall/install
51 $(INSTALL_DIR) $(1)/sbin
52 $(INSTALL_BIN) $(PKG_BUILD_DIR)/firewall3 $(1)/sbin/fw3
53 $(INSTALL_DIR) $(1)/etc/init.d
54 $(INSTALL_BIN) ./files/firewall.init $(1)/etc/init.d/firewall
55 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
56 $(INSTALL_DATA) ./files/firewall.hotplug $(1)/etc/hotplug.d/iface/20-firewall
57 $(INSTALL_DIR) $(1)/etc/config/
58 $(INSTALL_DATA) ./files/firewall.config $(1)/etc/config/firewall
59 $(INSTALL_DIR) $(1)/etc/
60 $(INSTALL_DATA) ./files/firewall.user $(1)/etc/firewall.user
63 $(eval $(call BuildPackage,firewall))