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.

176 lines
6.2 KiB

  1. # Based partially on the versions of el1n and Federico Di Marco
  2. include $(TOPDIR)/rules.mk
  3. PKG_NAME:=softethervpn5
  4. PKG_VERSION:=5.02.5180
  5. PKG_RELEASE:=$(AUTORELEASE)
  6. PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
  7. PKG_LICENSE:=GPL-2.0
  8. PKG_LICENSE_FILES:=COPYING
  9. PKG_SOURCE_URL:=https://github.com/SoftEtherVPN/SoftEtherVPN/releases/download/$(PKG_VERSION)/
  10. PKG_SOURCE:=SoftEtherVPN-$(PKG_VERSION).tar.xz
  11. PKG_HASH:=b5649a8ea3cc6477325e09e2248ef708d434ee3b2251eb8764bcfc15fb1de456
  12. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/SoftEtherVPN-$(PKG_VERSION)
  13. PKG_BUILD_DIR:=$(BUILD_DIR)/SoftEtherVPN-$(PKG_VERSION)
  14. HOST_BUILD_DEPENDS:=ncurses/host readline/host
  15. PKG_BUILD_DEPENDS:=softethervpn5/host
  16. include $(INCLUDE_DIR)/package.mk
  17. include $(INCLUDE_DIR)/host-build.mk
  18. include $(INCLUDE_DIR)/nls.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. define Package/softethervpn5/Default
  21. SECTION:=net
  22. CATEGORY:=Network
  23. SUBMENU:=VPN
  24. TITLE:=softethervpn5 v$(PKG_VERSION)
  25. URL:=http://www.softether.org/
  26. endef
  27. define Package/softethervpn5/Default/description
  28. SoftEther VPN supports SSL-VPN, OpenVPN, L2TP, EtherIP, L2TPv3 and IPsec as a single VPN software.
  29. SoftEther VPN is not only an alternative VPN server to existing VPN products (OpenVPN, IPsec and MS-SSTP),
  30. but has also original strong SSL-VPN protocol to penetrate any kinds of firewalls.
  31. Guide: https://wordpress.tirlins.com/2015/03/setting-up-softether-vpn-on-openwrt/
  32. endef
  33. define Package/softethervpn5-libs
  34. $(call Package/softethervpn5/Default)
  35. DEPENDS:=+libsodium +libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
  36. TITLE+= libs
  37. HIDDEN:=1
  38. endef
  39. define Package/softethervpn5-server
  40. $(call Package/softethervpn5/Default)
  41. TITLE+= server
  42. DEPENDS:= +softethervpn5-libs
  43. endef
  44. define Package/softethervpn5-server/description
  45. $(call Package/softethervpn5/Default/description)
  46. Provides the vpnserver (daemon).
  47. endef
  48. define Package/softethervpn5-bridge
  49. $(call Package/softethervpn5/Default)
  50. TITLE+= bridge
  51. DEPENDS:= +softethervpn5-libs
  52. endef
  53. define Package/softethervpn5-bridge/description
  54. $(call Package/softethervpn5/Default/description)
  55. Provides the vpnbridge (daemon).
  56. endef
  57. define Package/softethervpn5-client
  58. $(call Package/softethervpn5/Default)
  59. TITLE+= client
  60. DEPENDS:= +softethervpn5-libs
  61. endef
  62. define Package/softethervpn5-client/description
  63. $(call Package/softethervpn5/Default/description)
  64. Provides the vpnclient.
  65. endef
  66. export USE_MUSL=YES
  67. # BUG: outdated host/include/elf.h
  68. HOST_CFLAGS += $(FPIC) -DAT_HWCAP2=26
  69. TARGET_CFLAGS += $(FPIC)
  70. CMAKE_OPTIONS += -DICONV_LIB_PATH="$(ICONV_PREFIX)/lib"
  71. # static build for host (hamcorebuilder), avoid -fpic on ncurses/host and shared libs can't be found on host
  72. define Host/Prepare
  73. $(Host/Prepare/Default)
  74. $(SED) 's,SHARED,STATIC,g' $(HOST_BUILD_DIR)/src/Mayaqua/CMakeLists.txt
  75. $(SED) 's,SHARED,STATIC,g' $(HOST_BUILD_DIR)/src/Cedar/CMakeLists.txt
  76. $(SED) 's,readline,libreadline.a,g' $(HOST_BUILD_DIR)/src/Cedar/CMakeLists.txt
  77. $(SED) 's,libsodium REQUIRED,libsodium,g' $(HOST_BUILD_DIR)/src/Cedar/CMakeLists.txt
  78. endef
  79. define Host/Compile
  80. $(call Host/Compile/Default,hamcorebuilder)
  81. endef
  82. define Host/Install
  83. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
  84. $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/hamcorebuilder/hamcorebuilder $(STAGING_DIR_HOSTPKG)/bin/
  85. endef
  86. # disable SSE detection, disables BLAKE2 lib
  87. define Build/Prepare
  88. $(call Build/Prepare/Default)
  89. $(SED) 's,cmake_host_system_information,#cmake_host_system_information,g' $(PKG_BUILD_DIR)/src/Cedar/CMakeLists.txt
  90. endef
  91. define Build/Compile
  92. $(call Build/Compile/Default,vpnserver vpnbridge vpnclient vpncmd hamcore-archive-build)
  93. endef
  94. define Package/softethervpn5-libs/install
  95. $(INSTALL_DIR) $(1)/usr/lib
  96. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcedar.so $(1)/usr/lib/
  97. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmayaqua.so $(1)/usr/lib/
  98. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  99. $(CP) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpncmd/hamcore.se2 $(1)/usr/libexec/softethervpn/
  100. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpncmd/vpncmd $(1)/usr/libexec/softethervpn/
  101. $(INSTALL_DIR) $(1)/usr/bin
  102. if [ -f $(PKG_INSTALL_DIR)/usr/bin/list_cpu_features ]; then \
  103. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/list_cpu_features $(1)/usr/bin/ ; fi
  104. $(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn/
  105. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/lang.config
  106. $(INSTALL_DIR) $(1)/usr/bin
  107. $(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpncmd
  108. endef
  109. define Package/softethervpn5-server/install
  110. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  111. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpnserver/vpnserver $(1)/usr/libexec/softethervpn/
  112. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_server.config
  113. $(INSTALL_DIR) $(1)/etc/init.d
  114. $(INSTALL_BIN) files/vpnserver.init $(1)/etc/init.d/softethervpnserver
  115. endef
  116. define Package/softethervpn5-bridge/install
  117. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  118. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpnbridge/vpnbridge $(1)/usr/libexec/softethervpn/
  119. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_bridge.config
  120. $(INSTALL_DIR) $(1)/etc/init.d
  121. $(INSTALL_BIN) files/vpnbridge.init $(1)/etc/init.d/softethervpnbridge
  122. endef
  123. define Package/softethervpn5-client/install
  124. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  125. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpnclient/vpnclient $(1)/usr/libexec/softethervpn/
  126. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_client.config
  127. $(INSTALL_DIR) $(1)/etc/init.d
  128. $(INSTALL_BIN) files/vpnclient.init $(1)/etc/init.d/softethervpnclient
  129. endef
  130. define Package/softethervpn5-server/conffiles
  131. /usr/libexec/softethervpn/vpn_server.config
  132. /usr/libexec/softethervpn/lang.config
  133. endef
  134. define Package/softethervpn5-bridge/conffiles
  135. /usr/libexec/softethervpn/vpn_bridge.config
  136. /usr/libexec/softethervpn/lang.config
  137. endef
  138. define Package/softethervpn5-client/conffiles
  139. /usr/libexec/softethervpn/vpn_client.config
  140. /usr/libexec/softethervpn/lang.config
  141. endef
  142. $(eval $(call HostBuild))
  143. $(eval $(call BuildPackage,softethervpn5-libs))
  144. $(eval $(call BuildPackage,softethervpn5-server))
  145. $(eval $(call BuildPackage,softethervpn5-bridge))
  146. $(eval $(call BuildPackage,softethervpn5-client))