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.

175 lines
4.7 KiB

  1. #
  2. # Copyright (C) 2012-2014 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:=14
  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://projects.universe-factory.net/attachments/download/75
  14. PKG_MD5SUM:=34f6bdebd0410a1fba7c8fd06fff7a05
  15. PKG_LICENSE:=BSD-2-Clause
  16. PKG_LICENSE_FILE:=COPYRIGHT
  17. PKG_CONFIG_DEPENDS:=\
  18. CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST \
  19. CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC \
  20. CONFIG_FASTD_ENABLE_METHOD_GENERIC_GMAC \
  21. CONFIG_FASTD_ENABLE_METHOD_GENERIC_POLY1305 \
  22. CONFIG_FASTD_ENABLE_METHOD_NULL \
  23. CONFIG_FASTD_ENABLE_METHOD_XSALSA20_POLY1305 \
  24. CONFIG_FASTD_ENABLE_CIPHER_AES128_CTR \
  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_WITH_CMDLINE_USER \
  30. CONFIG_FASTD_WITH_CMDLINE_LOGGING \
  31. CONFIG_FASTD_WITH_CMDLINE_OPERATION \
  32. CONFIG_FASTD_WITH_CMDLINE_COMMANDS \
  33. CONFIG_FASTD_WITH_VERIFY
  34. PKG_BUILD_DEPENDS:=nacl libuecc
  35. include $(INCLUDE_DIR)/package.mk
  36. include $(INCLUDE_DIR)/cmake.mk
  37. define Package/fastd
  38. SECTION:=net
  39. CATEGORY:=Network
  40. DEPENDS:=+kmod-tun +librt +libpthread
  41. TITLE:=Fast and Secure Tunneling Daemon
  42. URL:=https://projects.universe-factory.net/projects/fastd
  43. SUBMENU:=VPN
  44. endef
  45. define Package/fastd/config
  46. source "$(SOURCE)/Config.in"
  47. endef
  48. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  49. TARGET_LDFLAGS += -Wl,--gc-sections
  50. CMAKE_OPTIONS += \
  51. -DCMAKE_BUILD_TYPE:STRING=MINSIZEREL \
  52. -DWITH_METHOD_CIPHER_TEST:BOOL=FALSE \
  53. -DWITH_METHOD_COMPOSED_GMAC:BOOL=FALSE \
  54. -DWITH_METHOD_GENERIC_GMAC:BOOL=FALSE \
  55. -DWITH_METHOD_GENERIC_POLY1305:BOOL=FALSE \
  56. -DWITH_METHOD_NULL:BOOL=FALSE \
  57. -DWITH_METHOD_XSALSA20_POLY1305:BOOL=FALSE \
  58. -DWITH_CIPHER_AES128_CTR:BOOL=FALSE \
  59. -DWITH_CIPHER_NULL:BOOL=FALSE \
  60. -DWITH_CIPHER_SALSA20:BOOL=FALSE \
  61. -DWITH_CIPHER_SALSA2012:BOOL=FALSE \
  62. -DWITH_MAC_GHASH:BOOL=FALSE \
  63. -DWITH_CMDLINE_USER:BOOL=FALSE \
  64. -DWITH_CMDLINE_LOGGING:BOOL=FALSE \
  65. -DWITH_CMDLINE_OPERATION:BOOL=FALSE \
  66. -DWITH_CMDLINE_COMMANDS:BOOL=FALSE \
  67. -DWITH_VERIFY:BOOL=FALSE \
  68. -DWITH_CAPABILITIES:BOOL=FALSE \
  69. -DENABLE_SYSTEMD:BOOL=FALSE \
  70. -DENABLE_LIBSODIUM:BOOL=FALSE \
  71. -DENABLE_LTO:BOOL=TRUE
  72. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST),y)
  73. CMAKE_OPTIONS += -DWITH_METHOD_CIPHER_TEST:BOOL=TRUE
  74. endif
  75. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC),y)
  76. CMAKE_OPTIONS += -DWITH_METHOD_COMPOSED_GMAC:BOOL=TRUE
  77. endif
  78. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_GENERIC_GMAC),y)
  79. CMAKE_OPTIONS += -DWITH_METHOD_GENERIC_GMAC:BOOL=TRUE
  80. endif
  81. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_GENERIC_POLY1305),y)
  82. CMAKE_OPTIONS += -DWITH_METHOD_GENERIC_POLY1305:BOOL=TRUE
  83. endif
  84. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_NULL),y)
  85. CMAKE_OPTIONS += -DWITH_METHOD_NULL:BOOL=TRUE
  86. endif
  87. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_XSALSA20_POLY1305),y)
  88. CMAKE_OPTIONS += -DWITH_METHOD_XSALSA20_POLY1305:BOOL=TRUE
  89. endif
  90. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_AES128_CTR),y)
  91. CMAKE_OPTIONS += -DWITH_CIPHER_AES128_CTR:BOOL=TRUE
  92. endif
  93. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_NULL),y)
  94. CMAKE_OPTIONS += -DWITH_CIPHER_NULL:BOOL=TRUE
  95. endif
  96. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_SALSA20),y)
  97. CMAKE_OPTIONS += -DWITH_CIPHER_SALSA20:BOOL=TRUE
  98. endif
  99. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_SALSA2012),y)
  100. CMAKE_OPTIONS += -DWITH_CIPHER_SALSA2012:BOOL=TRUE
  101. endif
  102. ifeq ($(CONFIG_FASTD_ENABLE_MAC_GHASH),y)
  103. CMAKE_OPTIONS += -DWITH_MAC_GHASH:BOOL=TRUE
  104. endif
  105. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_USER),y)
  106. CMAKE_OPTIONS += -DWITH_CMDLINE_USER:BOOL=TRUE
  107. endif
  108. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_LOGGING),y)
  109. CMAKE_OPTIONS += -DWITH_CMDLINE_LOGGING:BOOL=TRUE
  110. endif
  111. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_OPERATION),y)
  112. CMAKE_OPTIONS += -DWITH_CMDLINE_OPERATION:BOOL=TRUE
  113. endif
  114. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_COMMANDS),y)
  115. CMAKE_OPTIONS += -DWITH_CMDLINE_COMMANDS:BOOL=TRUE
  116. endif
  117. ifeq ($(CONFIG_FASTD_WITH_VERIFY),y)
  118. CMAKE_OPTIONS += -DWITH_VERIFY:BOOL=TRUE
  119. endif
  120. define Package/fastd/description
  121. Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
  122. endef
  123. define Package/fastd/conffiles
  124. /etc/config/fastd
  125. endef
  126. define Package/fastd/install
  127. $(INSTALL_DIR) $(1)/usr/bin
  128. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fastd $(1)/usr/bin/
  129. $(INSTALL_DIR) $(1)/etc/init.d/
  130. $(INSTALL_BIN) files/fastd.init $(1)/etc/init.d/fastd
  131. $(INSTALL_DIR) $(1)/etc/config
  132. $(INSTALL_CONF) files/fastd.config $(1)/etc/config/fastd
  133. $(INSTALL_DIR) $(1)/etc/fastd
  134. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  135. $(INSTALL_DATA) files/fastd.upgrade $(1)/lib/upgrade/keep.d/fastd
  136. endef
  137. $(eval $(call BuildPackage,fastd))