You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
3.9 KiB

  1. #
  2. # Copyright (C) 2012-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=fastd
  9. PKG_VERSION:=22
  10. PKG_RELEASE=3
  11. PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=https://github.com/NeoRaider/fastd/releases/download/v$(PKG_VERSION)
  14. PKG_HASH:=19750b88705d66811b7c21b672537909c19ae6b21350688cbd1a3a54d08a8951
  15. PKG_LICENSE:=BSD-2-Clause LGPL-2.1-or-later
  16. PKG_LICENSE_FILES:=COPYRIGHT src/dep/libmnl/COPYING
  17. PKG_CONFIG_DEPENDS:=\
  18. CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST \
  19. CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC \
  20. CONFIG_FASTD_ENABLE_METHOD_COMPOSED_UMAC \
  21. CONFIG_FASTD_ENABLE_METHOD_GENERIC_GMAC \
  22. CONFIG_FASTD_ENABLE_METHOD_GENERIC_POLY1305 \
  23. CONFIG_FASTD_ENABLE_METHOD_GENERIC_UMAC \
  24. CONFIG_FASTD_ENABLE_METHOD_NULL \
  25. CONFIG_FASTD_ENABLE_METHOD_NULL_L2TP \
  26. CONFIG_FASTD_ENABLE_CIPHER_NULL \
  27. CONFIG_FASTD_ENABLE_CIPHER_SALSA20 \
  28. CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 \
  29. CONFIG_FASTD_ENABLE_MAC_GHASH \
  30. CONFIG_FASTD_ENABLE_MAC_UHASH \
  31. CONFIG_FASTD_WITH_CAPABILITIES \
  32. CONFIG_FASTD_WITH_CMDLINE_USER \
  33. CONFIG_FASTD_WITH_CMDLINE_LOGGING \
  34. CONFIG_FASTD_WITH_CMDLINE_OPERATION \
  35. CONFIG_FASTD_WITH_CMDLINE_COMMANDS \
  36. CONFIG_FASTD_WITH_DYNAMIC_PEERS \
  37. CONFIG_FASTD_WITH_STATUS_SOCKET \
  38. CONFIG_FASTD_WITH_OFFLOAD_L2TP
  39. PKG_BUILD_DEPENDS:=nacl
  40. include $(INCLUDE_DIR)/package.mk
  41. include $(INCLUDE_DIR)/meson.mk
  42. define Package/fastd
  43. SECTION:=net
  44. CATEGORY:=Network
  45. DEPENDS:=+kmod-tun +libpthread +libuecc +FASTD_WITH_STATUS_SOCKET:libjson-c +FASTD_WITH_CAPABILITIES:libcap
  46. TITLE:=Fast and Secure Tunneling Daemon
  47. URL:=https://github.com/NeoRaider/fastd/
  48. SUBMENU:=VPN
  49. endef
  50. define Package/fastd/config
  51. source "$(SOURCE)/Config.in"
  52. endef
  53. feature = $(if $(CONFIG_FASTD_$(1)),enabled,disabled)
  54. MESON_ARGS += \
  55. -Dcapabilities=$(call feature,WITH_CAPABILITIES) \
  56. -Dcipher_aes128-ctr=disabled \
  57. -Dcipher_null=$(call feature,ENABLE_CIPHER_NULL) \
  58. -Dcipher_salsa20=$(call feature,ENABLE_CIPHER_SALSA20) \
  59. -Dcipher_salsa2012=$(call feature,ENABLE_CIPHER_SALSA2012) \
  60. -Dcmdline_commands=$(call feature,WITH_CMDLINE_COMMANDS) \
  61. -Dcmdline_logging=$(call feature,WITH_CMDLINE_LOGGING) \
  62. -Dcmdline_operation=$(call feature,WITH_CMDLINE_OPERATION) \
  63. -Dcmdline_user=$(call feature,WITH_CMDLINE_USER) \
  64. -Ddynamic_peers=$(call feature,WITH_DYNAMIC_PEERS) \
  65. -Dmac_ghash=$(call feature,ENABLE_MAC_GHASH) \
  66. -Dmac_uhash=$(call feature,ENABLE_MAC_UHASH) \
  67. -Dmethod_cipher-test=$(call feature,ENABLE_METHOD_CIPHER_TEST) \
  68. -Dmethod_composed-gmac=$(call feature,ENABLE_METHOD_COMPOSED_GMAC) \
  69. -Dmethod_composed-umac=$(call feature,ENABLE_METHOD_COMPOSED_UMAC) \
  70. -Dmethod_generic-gmac=$(call feature,ENABLE_METHOD_GENERIC_GMAC) \
  71. -Dmethod_generic-poly1305=$(call feature,ENABLE_METHOD_GENERIC_POLY1305) \
  72. -Dmethod_generic-umac=$(call feature,ENABLE_METHOD_GENERIC_UMAC) \
  73. -Dmethod_null=$(call feature,ENABLE_METHOD_NULL) \
  74. -Dmethod_null_l2tp=$(call feature,ENABLE_METHOD_NULL_L2TP) \
  75. -Dstatus_socket=$(call feature,WITH_STATUS_SOCKET) \
  76. -Doffload_l2tp=$(call feature,WITH_OFFLOAD_L2TP) \
  77. -Dlibmnl_builtin=true \
  78. -Dsystemd=disabled \
  79. -Duse_nacl=true \
  80. -Db_lto=true \
  81. -Dprefix=/usr
  82. define Package/fastd/description
  83. Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
  84. endef
  85. define Package/fastd/conffiles
  86. /etc/config/fastd
  87. endef
  88. define Package/fastd/install
  89. $(INSTALL_DIR) $(1)/usr/bin
  90. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fastd $(1)/usr/bin/
  91. $(INSTALL_DIR) $(1)/etc/init.d/
  92. $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.init $(1)/etc/init.d/fastd
  93. $(INSTALL_DIR) $(1)/etc/config
  94. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.config $(1)/etc/config/fastd
  95. $(INSTALL_DIR) $(1)/etc/fastd
  96. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  97. $(INSTALL_DATA) files/fastd.upgrade $(1)/lib/upgrade/keep.d/fastd
  98. endef
  99. $(eval $(call BuildPackage,fastd))