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.

171 lines
5.6 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.01.9667
  5. PKG_RELEASE:=1
  6. PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
  7. PKG_LICENSE:=GPL-2.0
  8. PKG_LICENSE_FILES:=COPYING
  9. PKG_SOURCE:=softether-vpn-src-$(PKG_VERSION).tar.gz
  10. PKG_SOURCE_URL:=https://github.com/SoftEtherVPN/SoftEtherVPN/releases/download/$(PKG_VERSION)
  11. PKG_HASH:=c99142c5e55fae055955332964c56d29aba10bec9764ab961aebabf6c3ee1462
  12. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  13. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(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. TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
  21. define Package/softethervpn5/Default
  22. SECTION:=net
  23. CATEGORY:=Network
  24. SUBMENU:=VPN
  25. TITLE:=softethervpn5 v$(PKG_VERSION)
  26. URL:=http://www.softether.org/
  27. endef
  28. define Package/softethervpn5/Default/description
  29. SoftEther VPN supports SSL-VPN, OpenVPN, L2TP, EtherIP, L2TPv3 and IPsec as a single VPN software.
  30. SoftEther VPN is not only an alternative VPN server to existing VPN products (OpenVPN, IPsec and MS-SSTP),
  31. but has also original strong SSL-VPN protocol to penetrate any kinds of firewalls.
  32. Guide: https://wordpress.tirlins.com/2015/03/setting-up-softether-vpn-on-openwrt/
  33. endef
  34. define Package/softethervpn5-libs
  35. $(call Package/softethervpn5/Default)
  36. DEPENDS:=+libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
  37. TITLE+= libs
  38. HIDDEN:=1
  39. endef
  40. define Package/softethervpn5-server
  41. $(call Package/softethervpn5/Default)
  42. TITLE+= server
  43. DEPENDS:= +softethervpn5-libs
  44. endef
  45. define Package/softethervpn5-server/description
  46. $(call Package/softethervpn5/Default/description)
  47. Provides the vpnserver (daemon).
  48. endef
  49. define Package/softethervpn5-bridge
  50. $(call Package/softethervpn5/Default)
  51. TITLE+= bridge
  52. DEPENDS:= +softethervpn5-libs
  53. endef
  54. define Package/softethervpn5-bridge/description
  55. $(call Package/softethervpn5/Default/description)
  56. Provides the vpnbridge (daemon).
  57. endef
  58. define Package/softethervpn5-client
  59. $(call Package/softethervpn5/Default)
  60. TITLE+= client
  61. DEPENDS:= +softethervpn5-libs
  62. endef
  63. define Package/softethervpn5-client/description
  64. $(call Package/softethervpn5/Default/description)
  65. Provides the vpnclient.
  66. endef
  67. export USE_MUSL=YES
  68. # BUG: outdated host/include/elf.h
  69. HOST_CFLAGS += $(FPIC) -DAT_HWCAP2=26
  70. TARGET_CFLAGS += $(FPIC)
  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. endef
  77. define Host/Compile
  78. $(call Host/Compile/Default,hamcorebuilder)
  79. endef
  80. define Host/Install
  81. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
  82. $(INSTALL_BIN) $(HOST_BUILD_DIR)/tmp/hamcorebuilder $(STAGING_DIR_HOSTPKG)/bin/
  83. endef
  84. define Build/Compile
  85. $(call Build/Compile/Default,vpnserver vpnbridge vpnclient vpncmd hamcore-archive-build)
  86. endef
  87. define Build/Install
  88. endef
  89. define Package/softethervpn5-libs/install
  90. $(INSTALL_DIR) $(1)/usr/lib
  91. $(CP) $(PKG_BUILD_DIR)/build/libcedar.so $(1)/usr/lib/
  92. $(CP) $(PKG_BUILD_DIR)/build/libmayaqua.so $(1)/usr/lib/
  93. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  94. $(CP) $(PKG_BUILD_DIR)/build/hamcore.se2 $(1)/usr/libexec/softethervpn/
  95. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpncmd $(1)/usr/libexec/softethervpn/
  96. $(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn/
  97. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/lang.config
  98. $(INSTALL_DIR) $(1)/usr/bin
  99. $(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpncmd
  100. endef
  101. define Package/softethervpn5-server/install
  102. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  103. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpnserver $(1)/usr/libexec/softethervpn/
  104. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_server.config
  105. $(INSTALL_DIR) $(1)/etc/init.d
  106. $(INSTALL_BIN) files/vpnserver.init $(1)/etc/init.d/softethervpnserver
  107. endef
  108. define Package/softethervpn5-bridge/install
  109. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  110. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpnbridge $(1)/usr/libexec/softethervpn/
  111. $(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn/
  112. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_bridge.config
  113. $(INSTALL_DIR) $(1)/etc/init.d
  114. $(INSTALL_BIN) files/vpnbridge.init $(1)/etc/init.d/softethervpnbridge
  115. endef
  116. define Package/softethervpn5-client/install
  117. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  118. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpnclient $(1)/usr/libexec/softethervpn/
  119. $(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn/
  120. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_client.config
  121. $(INSTALL_DIR) $(1)/etc/init.d
  122. $(INSTALL_BIN) files/vpnclient.init $(1)/etc/init.d/softethervpnclient
  123. endef
  124. define Package/softethervpn5-server/conffiles
  125. /usr/libexec/softethervpn/vpn_server.config
  126. /usr/libexec/softethervpn/lang.config
  127. endef
  128. define Package/softethervpn5-bridge/conffiles
  129. /usr/libexec/softethervpn/vpn_bridge.config
  130. /usr/libexec/softethervpn/lang.config
  131. endef
  132. define Package/softethervpn5-client/conffiles
  133. /usr/libexec/softethervpn/vpn_client.config
  134. /usr/libexec/softethervpn/lang.config
  135. endef
  136. $(eval $(call HostBuild))
  137. $(eval $(call BuildPackage,softethervpn5-libs))
  138. $(eval $(call BuildPackage,softethervpn5-server))
  139. $(eval $(call BuildPackage,softethervpn5-bridge))
  140. $(eval $(call BuildPackage,softethervpn5-client))