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.

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