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.

195 lines
5.4 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:=19
  10. PKG_RELEASE:=1
  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:=6054608e2103b634c9d19ecd1ae058d4ec694747047130719db180578729783a
  15. PKG_LICENSE:=BSD-2-Clause
  16. PKG_LICENSE_FILES:=COPYRIGHT
  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_CIPHER_NULL \
  26. CONFIG_FASTD_ENABLE_CIPHER_SALSA20 \
  27. CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 \
  28. CONFIG_FASTD_ENABLE_MAC_GHASH \
  29. CONFIG_FASTD_ENABLE_MAC_UHASH \
  30. CONFIG_FASTD_WITH_CAPABILITIES \
  31. CONFIG_FASTD_WITH_CMDLINE_USER \
  32. CONFIG_FASTD_WITH_CMDLINE_LOGGING \
  33. CONFIG_FASTD_WITH_CMDLINE_OPERATION \
  34. CONFIG_FASTD_WITH_CMDLINE_COMMANDS \
  35. CONFIG_FASTD_WITH_DYNAMIC_PEERS \
  36. CONFIG_FASTD_WITH_STATUS_SOCKET
  37. PKG_BUILD_DEPENDS:=nacl
  38. PKG_BUILD_PARALLEL:=1
  39. include $(INCLUDE_DIR)/package.mk
  40. include $(INCLUDE_DIR)/cmake.mk
  41. define Package/fastd
  42. SECTION:=net
  43. CATEGORY:=Network
  44. DEPENDS:=+kmod-tun +librt +libpthread +libuecc +FASTD_WITH_STATUS_SOCKET:libjson-c +FASTD_WITH_CAPABILITIES:libcap
  45. TITLE:=Fast and Secure Tunneling Daemon
  46. URL:=https://github.com/NeoRaider/fastd/
  47. SUBMENU:=VPN
  48. endef
  49. define Package/fastd/config
  50. source "$(SOURCE)/Config.in"
  51. endef
  52. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  53. TARGET_LDFLAGS += -Wl,--gc-sections
  54. CMAKE_OPTIONS += \
  55. -DCMAKE_BUILD_TYPE:STRING=MINSIZEREL \
  56. -DWITH_METHOD_CIPHER_TEST:BOOL=FALSE \
  57. -DWITH_METHOD_COMPOSED_GMAC:BOOL=FALSE \
  58. -DWITH_METHOD_COMPOSED_UMAC:BOOL=FALSE \
  59. -DWITH_METHOD_GENERIC_GMAC:BOOL=FALSE \
  60. -DWITH_METHOD_GENERIC_POLY1305:BOOL=FALSE \
  61. -DWITH_METHOD_GENERIC_UMAC:BOOL=FALSE \
  62. -DWITH_METHOD_NULL:BOOL=FALSE \
  63. -DWITH_CIPHER_AES128_CTR:BOOL=FALSE \
  64. -DWITH_CIPHER_NULL:BOOL=FALSE \
  65. -DWITH_CIPHER_SALSA20:BOOL=FALSE \
  66. -DWITH_CIPHER_SALSA2012:BOOL=FALSE \
  67. -DWITH_MAC_GHASH:BOOL=FALSE \
  68. -DWITH_MAC_UHASH:BOOL=FALSE \
  69. -DWITH_CAPABILITIES:BOOL=FALSE \
  70. -DWITH_CMDLINE_USER:BOOL=FALSE \
  71. -DWITH_CMDLINE_LOGGING:BOOL=FALSE \
  72. -DWITH_CMDLINE_OPERATION:BOOL=FALSE \
  73. -DWITH_CMDLINE_COMMANDS:BOOL=FALSE \
  74. -DWITH_DYNAMIC_PEERS:BOOL=FALSE \
  75. -DWITH_STATUS_SOCKET:BOOL=FALSE \
  76. -DENABLE_SYSTEMD:BOOL=FALSE \
  77. -DENABLE_LIBSODIUM:BOOL=FALSE \
  78. -DENABLE_LTO:BOOL=TRUE
  79. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST),y)
  80. CMAKE_OPTIONS += -DWITH_METHOD_CIPHER_TEST:BOOL=TRUE
  81. endif
  82. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC),y)
  83. CMAKE_OPTIONS += -DWITH_METHOD_COMPOSED_GMAC:BOOL=TRUE
  84. endif
  85. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_COMPOSED_UMAC),y)
  86. CMAKE_OPTIONS += -DWITH_METHOD_COMPOSED_UMAC:BOOL=TRUE
  87. endif
  88. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_GENERIC_GMAC),y)
  89. CMAKE_OPTIONS += -DWITH_METHOD_GENERIC_GMAC:BOOL=TRUE
  90. endif
  91. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_GENERIC_POLY1305),y)
  92. CMAKE_OPTIONS += -DWITH_METHOD_GENERIC_POLY1305:BOOL=TRUE
  93. endif
  94. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_GENERIC_UMAC),y)
  95. CMAKE_OPTIONS += -DWITH_METHOD_GENERIC_UMAC:BOOL=TRUE
  96. endif
  97. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_NULL),y)
  98. CMAKE_OPTIONS += -DWITH_METHOD_NULL:BOOL=TRUE
  99. endif
  100. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_NULL),y)
  101. CMAKE_OPTIONS += -DWITH_CIPHER_NULL:BOOL=TRUE
  102. endif
  103. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_SALSA20),y)
  104. CMAKE_OPTIONS += -DWITH_CIPHER_SALSA20:BOOL=TRUE
  105. endif
  106. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_SALSA2012),y)
  107. CMAKE_OPTIONS += -DWITH_CIPHER_SALSA2012:BOOL=TRUE
  108. endif
  109. ifeq ($(CONFIG_FASTD_ENABLE_MAC_GHASH),y)
  110. CMAKE_OPTIONS += -DWITH_MAC_GHASH:BOOL=TRUE
  111. endif
  112. ifeq ($(CONFIG_FASTD_ENABLE_MAC_UHASH),y)
  113. CMAKE_OPTIONS += -DWITH_MAC_UHASH:BOOL=TRUE
  114. endif
  115. ifeq ($(CONFIG_FASTD_WITH_CAPABILITIES),y)
  116. CMAKE_OPTIONS += -DWITH_CAPABILITIES:BOOL=TRUE
  117. endif
  118. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_USER),y)
  119. CMAKE_OPTIONS += -DWITH_CMDLINE_USER:BOOL=TRUE
  120. endif
  121. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_LOGGING),y)
  122. CMAKE_OPTIONS += -DWITH_CMDLINE_LOGGING:BOOL=TRUE
  123. endif
  124. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_OPERATION),y)
  125. CMAKE_OPTIONS += -DWITH_CMDLINE_OPERATION:BOOL=TRUE
  126. endif
  127. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_COMMANDS),y)
  128. CMAKE_OPTIONS += -DWITH_CMDLINE_COMMANDS:BOOL=TRUE
  129. endif
  130. ifeq ($(CONFIG_FASTD_WITH_DYNAMIC_PEERS),y)
  131. CMAKE_OPTIONS += -DWITH_DYNAMIC_PEERS:BOOL=TRUE
  132. endif
  133. ifeq ($(CONFIG_FASTD_WITH_STATUS_SOCKET),y)
  134. CMAKE_OPTIONS += -DWITH_STATUS_SOCKET:BOOL=TRUE
  135. endif
  136. define Package/fastd/description
  137. Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
  138. endef
  139. define Package/fastd/conffiles
  140. /etc/config/fastd
  141. endef
  142. define Package/fastd/install
  143. $(INSTALL_DIR) $(1)/usr/bin
  144. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fastd $(1)/usr/bin/
  145. $(INSTALL_DIR) $(1)/etc/init.d/
  146. $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.init $(1)/etc/init.d/fastd
  147. $(INSTALL_DIR) $(1)/etc/config
  148. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.config $(1)/etc/config/fastd
  149. $(INSTALL_DIR) $(1)/etc/fastd
  150. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  151. $(INSTALL_DATA) files/fastd.upgrade $(1)/lib/upgrade/keep.d/fastd
  152. endef
  153. $(eval $(call BuildPackage,fastd))