Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. #
  3. # Copyright (C) 2015 OpenWrt.org
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=nftables
  7. PKG_VERSION:=1.0.8
  8. PKG_RELEASE:=1
  9. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  10. PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
  11. PKG_HASH:=9373740de41a82dbc98818e0a46a073faeb8a8d0689fa4fa1a74399c32bf3d50
  12. PKG_MAINTAINER:=
  13. PKG_LICENSE:=GPL-2.0
  14. PKG_LICENSE_FILES:=COPYING
  15. PKG_FIXUP:=autoreconf
  16. PKG_INSTALL:=1
  17. PKG_BUILD_FLAGS:=lto
  18. include $(INCLUDE_DIR)/package.mk
  19. DISABLE_NLS:=
  20. CONFIGURE_ARGS += \
  21. --disable-debug \
  22. --disable-man-doc \
  23. --with-mini-gmp \
  24. --without-cli \
  25. --disable-python
  26. define Package/nftables/Default
  27. SECTION:=net
  28. CATEGORY:=Network
  29. SUBMENU:=Firewall
  30. TITLE:=nftables userspace utility
  31. DEPENDS:=+kmod-nft-core +libnftnl
  32. URL:=http://netfilter.org/projects/nftables/
  33. PROVIDES:=nftables
  34. endef
  35. define Package/nftables-nojson
  36. $(Package/nftables/Default)
  37. TITLE+= no JSON support
  38. VARIANT:=nojson
  39. DEFAULT_VARIANT:=1
  40. CONFLICTS:=nftables-json
  41. endef
  42. define Package/nftables-json
  43. $(Package/nftables/Default)
  44. TITLE+= with JSON support
  45. VARIANT:=json
  46. DEPENDS+=+jansson
  47. endef
  48. ifeq ($(BUILD_VARIANT),json)
  49. CONFIGURE_ARGS += --with-json
  50. endif
  51. define Build/InstallDev
  52. $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include
  53. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  54. $(CP) $(PKG_INSTALL_DIR)/usr/include/nftables $(1)/usr/include/
  55. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  56. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnftables.pc \
  57. $(1)/usr/lib/pkgconfig/
  58. endef
  59. define Package/nftables/install/Default
  60. $(INSTALL_DIR) $(1)/usr/sbin
  61. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/nft $(1)/usr/sbin/
  62. $(INSTALL_DIR) $(1)/usr/lib
  63. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  64. endef
  65. Package/nftables-nojson/install = $(Package/nftables/install/Default)
  66. Package/nftables-json/install = $(Package/nftables/install/Default)
  67. $(eval $(call BuildPackage,nftables-nojson))
  68. $(eval $(call BuildPackage,nftables-json))