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.

117 lines
4.0 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:=meson/host nacl
  40. PKG_BUILD_PARALLEL:=1
  41. include $(INCLUDE_DIR)/package.mk
  42. include ../../devel/meson/meson.mk
  43. define Package/fastd
  44. SECTION:=net
  45. CATEGORY:=Network
  46. DEPENDS:=+kmod-tun +libpthread +libuecc +FASTD_WITH_STATUS_SOCKET:libjson-c +FASTD_WITH_CAPABILITIES:libcap
  47. TITLE:=Fast and Secure Tunneling Daemon
  48. URL:=https://github.com/NeoRaider/fastd/
  49. SUBMENU:=VPN
  50. endef
  51. define Package/fastd/config
  52. source "$(SOURCE)/Config.in"
  53. endef
  54. feature = $(if $(CONFIG_FASTD_$(1)),enabled,disabled)
  55. MESON_ARGS += \
  56. -Dcapabilities=$(call feature,WITH_CAPABILITIES) \
  57. -Dcipher_aes128-ctr=disabled \
  58. -Dcipher_null=$(call feature,ENABLE_CIPHER_NULL) \
  59. -Dcipher_salsa20=$(call feature,ENABLE_CIPHER_SALSA20) \
  60. -Dcipher_salsa2012=$(call feature,ENABLE_CIPHER_SALSA2012) \
  61. -Dcmdline_commands=$(call feature,WITH_CMDLINE_COMMANDS) \
  62. -Dcmdline_logging=$(call feature,WITH_CMDLINE_LOGGING) \
  63. -Dcmdline_operation=$(call feature,WITH_CMDLINE_OPERATION) \
  64. -Dcmdline_user=$(call feature,WITH_CMDLINE_USER) \
  65. -Ddynamic_peers=$(call feature,WITH_DYNAMIC_PEERS) \
  66. -Dmac_ghash=$(call feature,ENABLE_MAC_GHASH) \
  67. -Dmac_uhash=$(call feature,ENABLE_MAC_UHASH) \
  68. -Dmethod_cipher-test=$(call feature,ENABLE_METHOD_CIPHER_TEST) \
  69. -Dmethod_composed-gmac=$(call feature,ENABLE_METHOD_COMPOSED_GMAC) \
  70. -Dmethod_composed-umac=$(call feature,ENABLE_METHOD_COMPOSED_UMAC) \
  71. -Dmethod_generic-gmac=$(call feature,ENABLE_METHOD_GENERIC_GMAC) \
  72. -Dmethod_generic-poly1305=$(call feature,ENABLE_METHOD_GENERIC_POLY1305) \
  73. -Dmethod_generic-umac=$(call feature,ENABLE_METHOD_GENERIC_UMAC) \
  74. -Dmethod_null=$(call feature,ENABLE_METHOD_NULL) \
  75. -Dmethod_null_l2tp=$(call feature,ENABLE_METHOD_NULL_L2TP) \
  76. -Dstatus_socket=$(call feature,WITH_STATUS_SOCKET) \
  77. -Doffload_l2tp=$(call feature,WITH_OFFLOAD_L2TP) \
  78. -Dlibmnl_builtin=true \
  79. -Dsystemd=disabled \
  80. -Duse_nacl=true \
  81. -Db_lto=true \
  82. -Dprefix=/usr
  83. define Package/fastd/description
  84. Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
  85. endef
  86. define Package/fastd/conffiles
  87. /etc/config/fastd
  88. endef
  89. define Package/fastd/install
  90. $(INSTALL_DIR) $(1)/usr/bin
  91. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fastd $(1)/usr/bin/
  92. $(INSTALL_DIR) $(1)/etc/init.d/
  93. $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.init $(1)/etc/init.d/fastd
  94. $(INSTALL_DIR) $(1)/etc/config
  95. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.config $(1)/etc/config/fastd
  96. $(INSTALL_DIR) $(1)/etc/fastd
  97. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  98. $(INSTALL_DATA) files/fastd.upgrade $(1)/lib/upgrade/keep.d/fastd
  99. endef
  100. $(eval $(call BuildPackage,fastd))