2 # Copyright (C) 2008-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 # Based on the initial porting done by el1n
9 include $(TOPDIR
)/rules.mk
11 PKG_NAME
:=softethervpn
12 PKG_VERSION
:=4.38-9760
16 PKG_SOURCE
:=softether-src-v
$(PKG_VERSION
)-$(PKG_VERREL
).
tar.gz
17 PKG_SOURCE_URL
:=https
://github.com
/SoftEtherVPN
/SoftEtherVPN_Stable
/releases
/download
/v
$(PKG_VERSION
)-$(PKG_VERREL
)
18 PKG_HASH
:=e68128b46171bd9f3f9ca38d10e60e8590a833bfc6488fa014674f9a22541f35
20 PKG_MAINTAINER
:=Federico Di Marco
<fededim@gmail.com
>
21 PKG_LICENSE
:=GPL-2.0
-or-later
22 PKG_LICENSE_FILES
:=COPYING
24 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)/v
$(PKG_VERSION
)
25 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/$(PKG_NAME
)/v
$(PKG_VERSION
)
26 PKG_BUILD_DEPENDS
:=softethervpn
/host
27 HOST_BUILD_DEPENDS
:=readline
/host
30 HAMCORE_SE2
:=$(STAGING_DIR_HOST
)/share
/softethervpn
/hamcore.se2
32 include $(INCLUDE_DIR
)/package.mk
33 include $(INCLUDE_DIR
)/host-build.mk
35 # Execute in host build directory
36 HOST_MAKE_FLAGS
+= -C
$(HOST_BUILD_DIR
)
38 # Select 32 or 64 bit Makefile for host build depending on host architecture
40 -f src
/makefiles
/$(if
$(CONFIG_HOST_OS_MACOS
),macos
,linux
)_
$(if
$(shell uname
-m | grep
64),64,32)bit.mak
42 # Prevent calling upstream configure
46 HOST_CFLAGS
+= $(if
$(CONFIG_HOST_OS_MACOS
),-Wno-implicit-function-declaration
,)
49 # Build hamcorebuilder using host compiler and let it generate
50 # the hamcore.se2 archive file
51 # CFLAGS, CPPFLAGS & LDFLAGS need to be passed with CC because they are being ingored
52 CC
="$(HOSTCC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(HOST_LDFLAGS)" $(MAKE
) $(HOST_MAKE_FLAGS
) \
53 src
/bin
/BuiltHamcoreFiles
/unix
/hamcore.se2
57 $(INSTALL_DIR
) $(STAGING_DIR_HOST
)/share
/softethervpn
58 $(INSTALL_DATA
) $(HOST_BUILD_DIR
)/src
/bin
/BuiltHamcoreFiles
/unix
/hamcore.se2
$(HAMCORE_SE2
)
62 # Tune CFLAGS for target
64 $(if
$(CONFIG_OPENSSL_WITH_SSL3
),,-DSSL_OP_NO_SSLv3
) \
65 $(if
$(filter mips mipsel
,$(ARCH
)),-minterlink-mips16
)
67 # Select 32 or 64 bit Makefile for target build depending on 64bit config symbol
69 -f src
/makefiles
/linux_
$(if
$(CONFIG_ARCH_64BIT
),64,32)bit.mak
71 # Map nonstandard CCFLAGS variable to standard TARGET_CFLAGS
73 CC
="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)"
75 define Build
/Configure
76 # Fetch prebuilt hamcore.se2 from staging dir
77 $(INSTALL_DIR
) $(PKG_BUILD_DIR
)/src
/bin
/BuiltHamcoreFiles
/unix
78 $(CP
) $(HAMCORE_SE2
) $(PKG_BUILD_DIR
)/src
/bin
/BuiltHamcoreFiles
/unix
/hamcore.se2
80 # Portably set hamcore.se2 modtime to one day in the future
81 # to prevent rebuilding it
82 perl
-e
'utime(time() + 86400, time() + 86400, $$$$ARGV[0])' \
83 $(PKG_BUILD_DIR
)/src
/bin
/BuiltHamcoreFiles
/unix
/hamcore.se2
87 define Package
/softethervpn
/default
91 TITLE
:=Free Cross-platform Multi-protocol VPN server and client
92 URL
:=http
://www.softether.org
/
95 define Package
/softethervpn
/description
96 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
97 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
98 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,
99 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,
100 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
101 has very fast throughput, low latency and firewall resistance.
104 define Package/softethervpn-base
105 $(Package/softethervpn/default)
106 DEPENDS:=+libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib
110 define Package/softethervpn-server
111 $(Package/softethervpn/default)
112 DEPENDS:=+softethervpn-base
116 define Package/softethervpn-bridge
117 $(Package/softethervpn/default)
118 DEPENDS:=+softethervpn-base
122 define Package/softethervpn-client
123 $(Package/softethervpn/default)
124 DEPENDS:=+softethervpn-base
128 Package/softethervpn-base/description = $(Package/softethervpn/description)
129 Package/softethervpn-server/description = $(Package/softethervpn/description)
130 Package/softethervpn-bridge/description = $(Package/softethervpn/description)
131 Package/softethervpn-client/description = $(Package/softethervpn/description)
133 define Package/softethervpn-base/conffiles
134 /usr/libexec/softethervpn/lang.config
137 define Package/softethervpn-server/conffiles
138 /usr/libexec/softethervpn/vpn_server.config
141 define Package/softethervpn-client/conffiles
142 /usr/libexec/softethervpn/vpn_client.config
145 define Package/softethervpn-bridge/conffiles
146 /usr/libexec/softethervpn/vpn_bridge.config
149 define Package/softethervpn-base/install
150 $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
151 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnserver/hamcore.se2 $(1)/usr/libexec/softethervpn
152 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpncmd/vpncmd $(1)/usr/libexec/softethervpn
153 $(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn
155 $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/lang.config
157 $(INSTALL_DIR) $(1)/usr/bin
158 $(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpncmd
161 define Package/softethervpn-server/install
162 $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
163 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnserver/vpnserver $(1)/usr/libexec/softethervpn
165 $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_server.config
167 $(INSTALL_DIR) $(1)/etc
168 $(INSTALL_DIR) $(1)/etc/init.d
169 $(INSTALL_BIN) files/vpnserver.init $(1)/etc/init.d/softethervpnserver
172 define Package/softethervpn-bridge/install
173 $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
174 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnbridge/vpnbridge $(1)/usr/libexec/softethervpn
176 $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_bridge.config
178 $(INSTALL_DIR) $(1)/etc
179 $(INSTALL_DIR) $(1)/etc/init.d
180 $(INSTALL_BIN) files/vpnbridge.init $(1)/etc/init.d/softethervpnbridge
183 define Package/softethervpn-client/install
184 $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
185 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnclient/vpnclient $(1)/usr/libexec/softethervpn
187 $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_client.config
189 $(INSTALL_DIR) $(1)/etc
190 $(INSTALL_DIR) $(1)/etc/init.d
191 $(INSTALL_BIN) files/vpnclient.init $(1)/etc/init.d/softethervpnclient
194 $(eval $(call BuildPackage,softethervpn-base))
195 $(eval $(call BuildPackage,softethervpn-server))
196 $(eval $(call BuildPackage,softethervpn-client))
197 $(eval $(call BuildPackage,softethervpn-bridge))
198 $(eval $(call HostBuild))