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.

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