Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=firewall
  10. PKG_RELEASE:=2
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git
  13. PKG_SOURCE_DATE:=2018-12-06
  14. PKG_SOURCE_VERSION:=14589c80cde937162da02414a0103653a566e866
  15. PKG_MIRROR_HASH:=c0ed3c441c619d4571e4fd5d75e537f72cbf0d9cbaf7d938b0f5cd524228dacc
  16. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  17. PKG_LICENSE:=ISC
  18. PKG_CONFIG_DEPENDS := CONFIG_IPV6
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. define Package/firewall
  22. SECTION:=net
  23. CATEGORY:=Base system
  24. TITLE:=libreCMC C Firewall
  25. DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +kmod-ipt-nat
  26. endef
  27. define Package/firewall/description
  28. This package provides a config-compatible C implementation of the UCI firewall.
  29. endef
  30. define Package/firewall/conffiles
  31. /etc/config/firewall
  32. /etc/firewall.user
  33. endef
  34. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  35. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  36. CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DDISABLE_IPV6=1)
  37. define Package/firewall/install
  38. $(INSTALL_DIR) $(1)/sbin
  39. $(INSTALL_BIN) $(PKG_BUILD_DIR)/firewall3 $(1)/sbin/fw3
  40. $(INSTALL_DIR) $(1)/etc/init.d
  41. $(INSTALL_BIN) ./files/firewall.init $(1)/etc/init.d/firewall
  42. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  43. $(INSTALL_CONF) ./files/firewall.hotplug $(1)/etc/hotplug.d/iface/20-firewall
  44. $(INSTALL_DIR) $(1)/etc/config/
  45. $(INSTALL_CONF) ./files/firewall.config $(1)/etc/config/firewall
  46. $(INSTALL_DIR) $(1)/etc/
  47. $(INSTALL_CONF) ./files/firewall.user $(1)/etc/firewall.user
  48. $(INSTALL_DIR) $(1)/usr/share/fw3
  49. $(INSTALL_CONF) $(PKG_BUILD_DIR)/helpers.conf $(1)/usr/share/fw3
  50. endef
  51. $(eval $(call BuildPackage,firewall))