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.

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