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
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.38-9760
  11. PKG_VERREL:=rtm
  12. PKG_RELEASE:=2
  13. PKG_SOURCE:=softether-src-v$(PKG_VERSION)-$(PKG_VERREL).tar.gz
  14. PKG_SOURCE_URL:=https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v$(PKG_VERSION)-$(PKG_VERREL)
  15. PKG_HASH:=e68128b46171bd9f3f9ca38d10e60e8590a833bfc6488fa014674f9a22541f35
  16. PKG_MAINTAINER:=Federico Di Marco <fededim@gmail.com>
  17. PKG_LICENSE:=GPL-2.0-or-later
  18. PKG_LICENSE_FILES:=COPYING
  19. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/v$(PKG_VERSION)
  20. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)/v$(PKG_VERSION)
  21. PKG_BUILD_DEPENDS:=softethervpn/host
  22. HOST_BUILD_DEPENDS:=readline/host libiconv/host
  23. PKG_ASLR_PIE:=0
  24. HAMCORE_SE2:=$(STAGING_DIR_HOST)/share/softethervpn/hamcore.se2
  25. include $(INCLUDE_DIR)/nls.mk
  26. include $(INCLUDE_DIR)/package.mk
  27. include $(INCLUDE_DIR)/host-build.mk
  28. # Execute in host build directory
  29. HOST_MAKE_FLAGS += -C $(HOST_BUILD_DIR)
  30. # Select 32 or 64 bit Makefile for host build depending on host architecture
  31. HOST_MAKE_FLAGS += \
  32. -f src/makefiles/$(if $(CONFIG_HOST_OS_MACOS),macos,linux)_$(if $(shell uname -m | grep 64),64,32)bit.mak
  33. # Prevent calling upstream configure
  34. define Host/Configure
  35. endef
  36. HOST_CFLAGS += $(if $(CONFIG_HOST_OS_MACOS),-Wno-implicit-function-declaration,)
  37. define Host/Compile
  38. # Build hamcorebuilder using host compiler and let it generate
  39. # the hamcore.se2 archive file
  40. # CFLAGS, CPPFLAGS & LDFLAGS need to be passed with CC because they are being ingored
  41. CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(HOST_LDFLAGS)" $(MAKE) $(HOST_MAKE_FLAGS) \
  42. src/bin/BuiltHamcoreFiles/unix/hamcore.se2
  43. endef
  44. define Host/Install
  45. $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/softethervpn
  46. $(INSTALL_DATA) $(HOST_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix/hamcore.se2 $(HAMCORE_SE2)
  47. endef
  48. # Tune CFLAGS for target
  49. TARGET_CFLAGS += \
  50. $(if $(CONFIG_OPENSSL_WITH_SSL3),,-DSSL_OP_NO_SSLv3) \
  51. $(if $(filter mips mipsel,$(ARCH)),-minterlink-mips16)
  52. # Select 32 or 64 bit Makefile for target build depending on 64bit config symbol
  53. MAKE_FLAGS += \
  54. -f src/makefiles/linux_$(if $(CONFIG_ARCH_64BIT),64,32)bit.mak
  55. # Map nonstandard CCFLAGS variable to standard TARGET_CFLAGS
  56. MAKE_FLAGS += \
  57. CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)"
  58. define Build/Configure
  59. # Fetch prebuilt hamcore.se2 from staging dir
  60. $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix
  61. $(CP) $(HAMCORE_SE2) $(PKG_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix/hamcore.se2
  62. # Portably set hamcore.se2 modtime to one day in the future
  63. # to prevent rebuilding it
  64. perl -e 'utime(time() + 86400, time() + 86400, $$$$ARGV[0])' \
  65. $(PKG_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix/hamcore.se2
  66. endef
  67. define Package/softethervpn/default
  68. SECTION:=net
  69. CATEGORY:=Network
  70. SUBMENU:=VPN
  71. TITLE:=Free Cross-platform Multi-protocol VPN server and client
  72. URL:=http://www.softether.org/
  73. endef
  74. define Package/softethervpn/description
  75. 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
  76. 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
  77. 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,
  78. 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,
  79. 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
  80. has very fast throughput, low latency and firewall resistance.
  81. endef
  82. define Package/softethervpn-base
  83. $(Package/softethervpn/default)
  84. DEPENDS:=+libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
  85. TITLE += (Base)
  86. endef
  87. define Package/softethervpn-server
  88. $(Package/softethervpn/default)
  89. DEPENDS:=+softethervpn-base
  90. TITLE += (Server)
  91. endef
  92. define Package/softethervpn-bridge
  93. $(Package/softethervpn/default)
  94. DEPENDS:=+softethervpn-base
  95. TITLE += (Bridge)
  96. endef
  97. define Package/softethervpn-client
  98. $(Package/softethervpn/default)
  99. DEPENDS:=+softethervpn-base
  100. TITLE += (Client)
  101. endef
  102. Package/softethervpn-base/description = $(Package/softethervpn/description)
  103. Package/softethervpn-server/description = $(Package/softethervpn/description)
  104. Package/softethervpn-bridge/description = $(Package/softethervpn/description)
  105. Package/softethervpn-client/description = $(Package/softethervpn/description)
  106. define Package/softethervpn-base/conffiles
  107. /usr/libexec/softethervpn/lang.config
  108. endef
  109. define Package/softethervpn-server/conffiles
  110. /usr/libexec/softethervpn/vpn_server.config
  111. endef
  112. define Package/softethervpn-client/conffiles
  113. /usr/libexec/softethervpn/vpn_client.config
  114. endef
  115. define Package/softethervpn-bridge/conffiles
  116. /usr/libexec/softethervpn/vpn_bridge.config
  117. endef
  118. define Package/softethervpn-base/install
  119. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  120. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnserver/hamcore.se2 $(1)/usr/libexec/softethervpn
  121. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpncmd/vpncmd $(1)/usr/libexec/softethervpn
  122. $(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn
  123. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/lang.config
  124. $(INSTALL_DIR) $(1)/usr/bin
  125. $(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpncmd
  126. endef
  127. define Package/softethervpn-server/install
  128. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  129. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnserver/vpnserver $(1)/usr/libexec/softethervpn
  130. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_server.config
  131. $(INSTALL_DIR) $(1)/etc
  132. $(INSTALL_DIR) $(1)/etc/init.d
  133. $(INSTALL_BIN) files/vpnserver.init $(1)/etc/init.d/softethervpnserver
  134. endef
  135. define Package/softethervpn-bridge/install
  136. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  137. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnbridge/vpnbridge $(1)/usr/libexec/softethervpn
  138. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_bridge.config
  139. $(INSTALL_DIR) $(1)/etc
  140. $(INSTALL_DIR) $(1)/etc/init.d
  141. $(INSTALL_BIN) files/vpnbridge.init $(1)/etc/init.d/softethervpnbridge
  142. endef
  143. define Package/softethervpn-client/install
  144. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  145. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnclient/vpnclient $(1)/usr/libexec/softethervpn
  146. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_client.config
  147. $(INSTALL_DIR) $(1)/etc
  148. $(INSTALL_DIR) $(1)/etc/init.d
  149. $(INSTALL_BIN) files/vpnclient.init $(1)/etc/init.d/softethervpnclient
  150. endef
  151. $(eval $(call BuildPackage,softethervpn-base))
  152. $(eval $(call BuildPackage,softethervpn-server))
  153. $(eval $(call BuildPackage,softethervpn-client))
  154. $(eval $(call BuildPackage,softethervpn-bridge))
  155. $(eval $(call HostBuild))