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.

198 lines
7.0 KiB

  1. #
  2. # Copyright (C) 2008-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # Based on the initial porting done by el1n
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=softethervpn
  10. PKG_VERSION:=4.29-9680
  11. PKG_VERREL:=rtm
  12. PKG_VERDATE:=2019.02.28
  13. PKG_RELEASE:=2
  14. PKG_SOURCE:=softether-src-v$(PKG_VERSION)-$(PKG_VERREL).tar.gz
  15. PKG_SOURCE_URL:=http://www.softether-download.com/files/softether/v$(PKG_VERSION)-$(PKG_VERREL)-$(PKG_VERDATE)-tree/Source_Code/
  16. PKG_HASH:=e6035fa7d9aaf59bdb342cd7ab5ecfdff89811a875f62a3230208cdc8a4e26e4
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/v$(PKG_VERSION)
  18. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)/v$(PKG_VERSION)
  19. PKG_LICENSE:=GPL-2.0
  20. PKG_LICENSE_FILES:=COPYING
  21. PKG_BUILD_DEPENDS:=softethervpn/host
  22. HOST_BUILD_DEPENDS:=readline/host libiconv/host
  23. HAMCORE_SE2:=$(STAGING_DIR_HOST)/share/softethervpn/hamcore.se2
  24. include $(INCLUDE_DIR)/nls.mk
  25. include $(INCLUDE_DIR)/package.mk
  26. include $(INCLUDE_DIR)/host-build.mk
  27. # Execute in host build directory
  28. HOST_MAKE_FLAGS += -C $(HOST_BUILD_DIR)
  29. # Select 32 or 64 bit Makefile for host build depending on host architecture
  30. HOST_MAKE_FLAGS += -f src/makefiles/linux_$(if $(shell uname -m | grep 64),64,32)bit.mak
  31. HOST_LDFLAGS += -Wl,-rpath="$(STAGING_DIR_HOSTPKG)/lib"
  32. # Prevent calling upstream configure
  33. define Host/Configure
  34. endef
  35. define Host/Compile
  36. # Build hamcorebuilder using host compiler and let it generate
  37. # the hamcore.se2 archive file
  38. # CFLAGS, CPPFLAGS & LDFLAGS need to be passed with CC because they are being ingored
  39. CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(HOST_LDFLAGS)" $(MAKE) $(HOST_MAKE_FLAGS) \
  40. src/bin/BuiltHamcoreFiles/unix/hamcore.se2
  41. endef
  42. define Host/Install
  43. $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/softethervpn
  44. $(INSTALL_DATA) $(HOST_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix/hamcore.se2 $(HAMCORE_SE2)
  45. endef
  46. # Tune CFLAGS for target
  47. TARGET_CFLAGS += \
  48. $(if $(CONFIG_OPENSSL_WITH_SSL3),,-DSSL_OP_NO_SSLv3) \
  49. $(if $(filter mips mipsel,$(ARCH)),-minterlink-mips16)
  50. # Select 32 or 64 bit Makefile for target build depending on 64bit config symbol
  51. MAKE_FLAGS += \
  52. -f src/makefiles/linux_$(if $(CONFIG_ARCH_64BIT),64,32)bit.mak
  53. # Map nonstandard CCFLAGS variable to standard TARGET_CFLAGS
  54. MAKE_FLAGS += \
  55. CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)"
  56. define Build/Configure
  57. # Fetch prebuilt hamcore.se2 from staging dir
  58. $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix
  59. $(CP) $(HAMCORE_SE2) $(PKG_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix/hamcore.se2
  60. # Portably set hamcore.se2 modtime to one day in the future
  61. # to prevent rebuilding it
  62. perl -e 'utime(time() + 86400, time() + 86400, $$$$ARGV[0])' \
  63. $(PKG_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix/hamcore.se2
  64. endef
  65. define Package/softethervpn/default
  66. SECTION:=net
  67. CATEGORY:=Network
  68. SUBMENU:=VPN
  69. TITLE:=Free Cross-platform Multi-protocol VPN server and client
  70. URL:=http://www.softether.org/
  71. MAINTAINER:=Federico Di Marco <fededim@gmail.com>
  72. endef
  73. define Package/softethervpn/description
  74. SoftEther VPN ("SoftEther" means "Software Ethernet") is one of the world's most powerful and easy-to-use multi-protocol VPN software developed as an academic
  75. project from University of Tsukuba, Japan. SoftEther VPN has strong compatibility to today's most popular VPN products among the world. It has the interoperability
  76. with OpenVPN, L2TP, IPsec, EtherIP, L2TPv3, Cisco VPN Routers and MS-SSTP VPN Clients. SoftEther VPN is the world's only VPN software which supports SSL-VPN,
  77. OpenVPN, L2TP, EtherIP, L2TPv3 and IPsec as a single VPN software. SoftEther VPN is not only an alternative VPN server to existing VPN products (OpenVPN,
  78. IPsec and MS-SSTP), but has also original strong SSL-VPN protocol to penetrate any kinds of firewalls. Ultra-optimized SSL-VPN Protocol of SoftEther VPN
  79. has very fast throughput, low latency and firewall resistance.
  80. endef
  81. define Package/softethervpn-base
  82. $(Package/softethervpn/default)
  83. DEPENDS:=+libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
  84. TITLE += (Base)
  85. endef
  86. define Package/softethervpn-server
  87. $(Package/softethervpn/default)
  88. DEPENDS:=+softethervpn-base
  89. TITLE += (Server)
  90. endef
  91. define Package/softethervpn-bridge
  92. $(Package/softethervpn/default)
  93. DEPENDS:=+softethervpn-base
  94. TITLE += (Bridge)
  95. endef
  96. define Package/softethervpn-client
  97. $(Package/softethervpn/default)
  98. DEPENDS:=+softethervpn-base
  99. TITLE += (Client)
  100. endef
  101. Package/softethervpn-base/description = $(Package/softethervpn/description)
  102. Package/softethervpn-server/description = $(Package/softethervpn/description)
  103. Package/softethervpn-bridge/description = $(Package/softethervpn/description)
  104. Package/softethervpn-client/description = $(Package/softethervpn/description)
  105. define Package/softethervpn-base/conffiles
  106. /usr/libexec/softethervpn/lang.config
  107. endef
  108. define Package/softethervpn-server/conffiles
  109. /usr/libexec/softethervpn/vpn_server.config
  110. endef
  111. define Package/softethervpn-client/conffiles
  112. /usr/libexec/softethervpn/vpn_client.config
  113. endef
  114. define Package/softethervpn-bridge/conffiles
  115. /usr/libexec/softethervpn/vpn_bridge.config
  116. endef
  117. define Package/softethervpn-base/install
  118. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  119. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnserver/hamcore.se2 $(1)/usr/libexec/softethervpn
  120. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpncmd/vpncmd $(1)/usr/libexec/softethervpn
  121. $(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn
  122. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/lang.config
  123. $(INSTALL_DIR) $(1)/usr/bin
  124. $(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpncmd
  125. endef
  126. define Package/softethervpn-server/install
  127. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  128. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnserver/vpnserver $(1)/usr/libexec/softethervpn
  129. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_server.config
  130. $(INSTALL_DIR) $(1)/etc
  131. $(INSTALL_DIR) $(1)/etc/init.d
  132. $(INSTALL_BIN) files/vpnserver.init $(1)/etc/init.d/softethervpnserver
  133. endef
  134. define Package/softethervpn-bridge/install
  135. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  136. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnbridge/vpnbridge $(1)/usr/libexec/softethervpn
  137. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_bridge.config
  138. $(INSTALL_DIR) $(1)/etc
  139. $(INSTALL_DIR) $(1)/etc/init.d
  140. $(INSTALL_BIN) files/vpnbridge.init $(1)/etc/init.d/softethervpnbridge
  141. endef
  142. define Package/softethervpn-client/install
  143. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  144. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnclient/vpnclient $(1)/usr/libexec/softethervpn
  145. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_client.config
  146. $(INSTALL_DIR) $(1)/etc
  147. $(INSTALL_DIR) $(1)/etc/init.d
  148. $(INSTALL_BIN) files/vpnclient.init $(1)/etc/init.d/softethervpnclient
  149. endef
  150. $(eval $(call BuildPackage,softethervpn-base))
  151. $(eval $(call BuildPackage,softethervpn-server))
  152. $(eval $(call BuildPackage,softethervpn-client))
  153. $(eval $(call BuildPackage,softethervpn-bridge))
  154. $(eval $(call HostBuild))