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.

199 lines
5.5 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:=2
  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_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_METHOD_XSALSA20_POLY1305 \
  26. CONFIG_FASTD_ENABLE_CIPHER_AES128_CTR \
  27. CONFIG_FASTD_ENABLE_CIPHER_NULL \
  28. CONFIG_FASTD_ENABLE_CIPHER_SALSA20 \
  29. CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 \
  30. CONFIG_FASTD_ENABLE_MAC_GHASH \
  31. CONFIG_FASTD_ENABLE_MAC_UHASH \
  32. CONFIG_FASTD_WITH_CMDLINE_USER \
  33. CONFIG_FASTD_WITH_CMDLINE_LOGGING \
  34. CONFIG_FASTD_WITH_CMDLINE_OPERATION \
  35. CONFIG_FASTD_WITH_CMDLINE_COMMANDS \
  36. CONFIG_FASTD_WITH_DYNAMIC_PEERS \
  37. CONFIG_FASTD_WITH_STATUS_SOCKET
  38. PKG_BUILD_DEPENDS:=nacl libuecc
  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 +FASTD_WITH_STATUS_SOCKET:libjson-c
  45. TITLE:=Fast and Secure Tunneling Daemon
  46. URL:=https://projects.universe-factory.net/projects/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_METHOD_XSALSA20_POLY1305:BOOL=FALSE \
  64. -DWITH_CIPHER_AES128_CTR:BOOL=FALSE \
  65. -DWITH_CIPHER_NULL:BOOL=FALSE \
  66. -DWITH_CIPHER_SALSA20:BOOL=FALSE \
  67. -DWITH_CIPHER_SALSA2012:BOOL=FALSE \
  68. -DWITH_MAC_GHASH:BOOL=FALSE \
  69. -DWITH_MAC_UHASH: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. -DWITH_CAPABILITIES:BOOL=FALSE \
  77. -DENABLE_SYSTEMD:BOOL=FALSE \
  78. -DENABLE_LIBSODIUM:BOOL=FALSE \
  79. -DENABLE_LTO:BOOL=TRUE
  80. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST),y)
  81. CMAKE_OPTIONS += -DWITH_METHOD_CIPHER_TEST:BOOL=TRUE
  82. endif
  83. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC),y)
  84. CMAKE_OPTIONS += -DWITH_METHOD_COMPOSED_GMAC:BOOL=TRUE
  85. endif
  86. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_COMPOSED_UMAC),y)
  87. CMAKE_OPTIONS += -DWITH_METHOD_COMPOSED_UMAC:BOOL=TRUE
  88. endif
  89. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_GENERIC_GMAC),y)
  90. CMAKE_OPTIONS += -DWITH_METHOD_GENERIC_GMAC:BOOL=TRUE
  91. endif
  92. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_GENERIC_POLY1305),y)
  93. CMAKE_OPTIONS += -DWITH_METHOD_GENERIC_POLY1305:BOOL=TRUE
  94. endif
  95. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_GENERIC_UMAC),y)
  96. CMAKE_OPTIONS += -DWITH_METHOD_GENERIC_UMAC:BOOL=TRUE
  97. endif
  98. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_NULL),y)
  99. CMAKE_OPTIONS += -DWITH_METHOD_NULL:BOOL=TRUE
  100. endif
  101. ifeq ($(CONFIG_FASTD_ENABLE_METHOD_XSALSA20_POLY1305),y)
  102. CMAKE_OPTIONS += -DWITH_METHOD_XSALSA20_POLY1305:BOOL=TRUE
  103. endif
  104. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_AES128_CTR),y)
  105. CMAKE_OPTIONS += -DWITH_CIPHER_AES128_CTR:BOOL=TRUE
  106. endif
  107. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_NULL),y)
  108. CMAKE_OPTIONS += -DWITH_CIPHER_NULL:BOOL=TRUE
  109. endif
  110. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_SALSA20),y)
  111. CMAKE_OPTIONS += -DWITH_CIPHER_SALSA20:BOOL=TRUE
  112. endif
  113. ifeq ($(CONFIG_FASTD_ENABLE_CIPHER_SALSA2012),y)
  114. CMAKE_OPTIONS += -DWITH_CIPHER_SALSA2012:BOOL=TRUE
  115. endif
  116. ifeq ($(CONFIG_FASTD_ENABLE_MAC_GHASH),y)
  117. CMAKE_OPTIONS += -DWITH_MAC_GHASH:BOOL=TRUE
  118. endif
  119. ifeq ($(CONFIG_FASTD_ENABLE_MAC_UHASH),y)
  120. CMAKE_OPTIONS += -DWITH_MAC_UHASH:BOOL=TRUE
  121. endif
  122. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_USER),y)
  123. CMAKE_OPTIONS += -DWITH_CMDLINE_USER:BOOL=TRUE
  124. endif
  125. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_LOGGING),y)
  126. CMAKE_OPTIONS += -DWITH_CMDLINE_LOGGING:BOOL=TRUE
  127. endif
  128. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_OPERATION),y)
  129. CMAKE_OPTIONS += -DWITH_CMDLINE_OPERATION:BOOL=TRUE
  130. endif
  131. ifeq ($(CONFIG_FASTD_WITH_CMDLINE_COMMANDS),y)
  132. CMAKE_OPTIONS += -DWITH_CMDLINE_COMMANDS:BOOL=TRUE
  133. endif
  134. ifeq ($(CONFIG_FASTD_WITH_DYNAMIC_PEERS),y)
  135. CMAKE_OPTIONS += -DWITH_DYNAMIC_PEERS:BOOL=TRUE
  136. endif
  137. ifeq ($(CONFIG_FASTD_WITH_STATUS_SOCKET),y)
  138. CMAKE_OPTIONS += -DWITH_STATUS_SOCKET:BOOL=TRUE
  139. endif
  140. define Package/fastd/description
  141. Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
  142. endef
  143. define Package/fastd/conffiles
  144. /etc/config/fastd
  145. endef
  146. define Package/fastd/install
  147. $(INSTALL_DIR) $(1)/usr/bin
  148. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fastd $(1)/usr/bin/
  149. $(INSTALL_DIR) $(1)/etc/init.d/
  150. $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.init $(1)/etc/init.d/fastd
  151. $(INSTALL_DIR) $(1)/etc/config
  152. $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.config $(1)/etc/config/fastd
  153. $(INSTALL_DIR) $(1)/etc/fastd
  154. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  155. $(INSTALL_DATA) files/fastd.upgrade $(1)/lib/upgrade/keep.d/fastd
  156. endef
  157. $(eval $(call BuildPackage,fastd))