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.

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