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.

166 lines
5.4 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.9670
  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_PROTO:=git
  10. PKG_SOURCE_URL:=https://github.com/SoftEtherVPN/SoftEtherVPN.git
  11. PKG_SOURCE_VERSION:=$(PKG_VERSION)
  12. PKG_MIRROR_HASH:=a7de5cf5e109450297af1bf79bc5f9ae15229d24da86b134b6251f8354b3dfb8
  13. HOST_BUILD_DEPENDS:=ncurses/host readline/host
  14. PKG_BUILD_DEPENDS:=softethervpn5/host
  15. include $(INCLUDE_DIR)/package.mk
  16. include $(INCLUDE_DIR)/host-build.mk
  17. include $(INCLUDE_DIR)/nls.mk
  18. include $(INCLUDE_DIR)/cmake.mk
  19. define Package/softethervpn5/Default
  20. SECTION:=net
  21. CATEGORY:=Network
  22. SUBMENU:=VPN
  23. TITLE:=softethervpn5 v$(PKG_VERSION)
  24. URL:=http://www.softether.org/
  25. endef
  26. define Package/softethervpn5/Default/description
  27. SoftEther VPN supports SSL-VPN, OpenVPN, L2TP, EtherIP, L2TPv3 and IPsec as a single VPN software.
  28. SoftEther VPN is not only an alternative VPN server to existing VPN products (OpenVPN, IPsec and MS-SSTP),
  29. but has also original strong SSL-VPN protocol to penetrate any kinds of firewalls.
  30. Guide: https://wordpress.tirlins.com/2015/03/setting-up-softether-vpn-on-openwrt/
  31. endef
  32. define Package/softethervpn5-libs
  33. $(call Package/softethervpn5/Default)
  34. DEPENDS:=+libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
  35. TITLE+= libs
  36. HIDDEN:=1
  37. endef
  38. define Package/softethervpn5-server
  39. $(call Package/softethervpn5/Default)
  40. TITLE+= server
  41. DEPENDS:= +softethervpn5-libs
  42. endef
  43. define Package/softethervpn5-server/description
  44. $(call Package/softethervpn5/Default/description)
  45. Provides the vpnserver (daemon).
  46. endef
  47. define Package/softethervpn5-bridge
  48. $(call Package/softethervpn5/Default)
  49. TITLE+= bridge
  50. DEPENDS:= +softethervpn5-libs
  51. endef
  52. define Package/softethervpn5-bridge/description
  53. $(call Package/softethervpn5/Default/description)
  54. Provides the vpnbridge (daemon).
  55. endef
  56. define Package/softethervpn5-client
  57. $(call Package/softethervpn5/Default)
  58. TITLE+= client
  59. DEPENDS:= +softethervpn5-libs
  60. endef
  61. define Package/softethervpn5-client/description
  62. $(call Package/softethervpn5/Default/description)
  63. Provides the vpnclient.
  64. endef
  65. export USE_MUSL=YES
  66. # BUG: outdated host/include/elf.h
  67. HOST_CFLAGS += $(FPIC) -DAT_HWCAP2=26
  68. TARGET_CFLAGS += $(FPIC)
  69. # static build for host (hamcorebuilder), avoid -fpic on ncurses/host and shared libs can't be found on host
  70. define Host/Prepare
  71. $(Host/Prepare/Default)
  72. $(SED) 's,SHARED,STATIC,g' $(HOST_BUILD_DIR)/src/Mayaqua/CMakeLists.txt
  73. $(SED) 's,SHARED,STATIC,g' $(HOST_BUILD_DIR)/src/Cedar/CMakeLists.txt
  74. $(SED) 's,readline,libreadline.a,g' $(HOST_BUILD_DIR)/src/Cedar/CMakeLists.txt
  75. endef
  76. define Host/Compile
  77. $(call Host/Compile/Default,hamcorebuilder)
  78. endef
  79. define Host/Install
  80. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
  81. $(INSTALL_BIN) $(HOST_BUILD_DIR)/tmp/hamcorebuilder $(STAGING_DIR_HOSTPKG)/bin/
  82. endef
  83. define Build/Compile
  84. $(call Build/Compile/Default,vpnserver vpnbridge vpnclient vpncmd hamcore-archive-build)
  85. endef
  86. define Build/Install
  87. endef
  88. define Package/softethervpn5-libs/install
  89. $(INSTALL_DIR) $(1)/usr/lib
  90. $(CP) $(PKG_BUILD_DIR)/build/libcedar.so $(1)/usr/lib/
  91. $(CP) $(PKG_BUILD_DIR)/build/libmayaqua.so $(1)/usr/lib/
  92. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  93. $(CP) $(PKG_BUILD_DIR)/build/hamcore.se2 $(1)/usr/libexec/softethervpn/
  94. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpncmd $(1)/usr/libexec/softethervpn/
  95. $(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn/
  96. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/lang.config
  97. $(INSTALL_DIR) $(1)/usr/bin
  98. $(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpncmd
  99. endef
  100. define Package/softethervpn5-server/install
  101. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  102. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpnserver $(1)/usr/libexec/softethervpn/
  103. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_server.config
  104. $(INSTALL_DIR) $(1)/etc/init.d
  105. $(INSTALL_BIN) files/vpnserver.init $(1)/etc/init.d/softethervpnserver
  106. endef
  107. define Package/softethervpn5-bridge/install
  108. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  109. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpnbridge $(1)/usr/libexec/softethervpn/
  110. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_bridge.config
  111. $(INSTALL_DIR) $(1)/etc/init.d
  112. $(INSTALL_BIN) files/vpnbridge.init $(1)/etc/init.d/softethervpnbridge
  113. endef
  114. define Package/softethervpn5-client/install
  115. $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
  116. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpnclient $(1)/usr/libexec/softethervpn/
  117. $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_client.config
  118. $(INSTALL_DIR) $(1)/etc/init.d
  119. $(INSTALL_BIN) files/vpnclient.init $(1)/etc/init.d/softethervpnclient
  120. endef
  121. define Package/softethervpn5-server/conffiles
  122. /usr/libexec/softethervpn/vpn_server.config
  123. /usr/libexec/softethervpn/lang.config
  124. endef
  125. define Package/softethervpn5-bridge/conffiles
  126. /usr/libexec/softethervpn/vpn_bridge.config
  127. /usr/libexec/softethervpn/lang.config
  128. endef
  129. define Package/softethervpn5-client/conffiles
  130. /usr/libexec/softethervpn/vpn_client.config
  131. /usr/libexec/softethervpn/lang.config
  132. endef
  133. $(eval $(call HostBuild))
  134. $(eval $(call BuildPackage,softethervpn5-libs))
  135. $(eval $(call BuildPackage,softethervpn5-server))
  136. $(eval $(call BuildPackage,softethervpn5-bridge))
  137. $(eval $(call BuildPackage,softethervpn5-client))