1 # Based partially on the versions of el1n and Federico Di Marco
3 include $(TOPDIR
)/rules.mk
5 PKG_NAME
:=softethervpn5
7 PKG_RELEASE
:=$(AUTORELEASE
)
10 PKG_LICENSE_FILES
:=COPYING
12 PKG_SOURCE_URL
:=https
://github.com
/SoftEtherVPN
/SoftEtherVPN
/releases
/download
/$(PKG_VERSION
)/
13 PKG_SOURCE
:=SoftEtherVPN-
$(PKG_VERSION
).
tar.xz
14 PKG_HASH
:=b5649a8ea3cc6477325e09e2248ef708d434ee3b2251eb8764bcfc15fb1de456
16 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/SoftEtherVPN-
$(PKG_VERSION
)
17 PKG_BUILD_DIR
:=$(BUILD_DIR
)/SoftEtherVPN-
$(PKG_VERSION
)
19 HOST_BUILD_DEPENDS
:=ncurses
/host readline
/host
20 PKG_BUILD_DEPENDS
:=softethervpn5
/host
22 include $(INCLUDE_DIR
)/package.mk
23 include $(INCLUDE_DIR
)/host-build.mk
24 include $(INCLUDE_DIR
)/nls.mk
25 include $(INCLUDE_DIR
)/cmake.mk
27 define Package
/softethervpn5
/Default
31 TITLE
:=softethervpn5 v
$(PKG_VERSION
)
32 URL
:=http
://www.softether.org
/
35 define Package
/softethervpn5
/Default
/description
36 SoftEther VPN supports SSL-VPN
, OpenVPN
, L2TP
, EtherIP
, L2TPv3 and IPsec
as a single VPN software.
37 SoftEther VPN is not only an alternative VPN server to existing VPN products
(OpenVPN
, IPsec and MS-SSTP
),
38 but has also original strong SSL-VPN protocol to penetrate any kinds of firewalls.
39 Guide
: https
://wordpress.tirlins.com
/2015/03/setting-up-softether-vpn-on-openwrt
/
42 define Package
/softethervpn5-libs
43 $(call Package
/softethervpn5
/Default
)
44 DEPENDS
:=+libsodium
+libpthread
+librt
+libreadline
+libopenssl
+libncurses
+kmod-tun
+zlib
$(ICONV_DEPENDS
)
49 define Package
/softethervpn5-server
50 $(call Package
/softethervpn5
/Default
)
52 DEPENDS
:= +softethervpn5-libs
54 define Package
/softethervpn5-server
/description
55 $(call Package
/softethervpn5
/Default
/description
)
57 Provides the vpnserver
(daemon
).
60 define Package
/softethervpn5-bridge
61 $(call Package
/softethervpn5
/Default
)
63 DEPENDS
:= +softethervpn5-libs
65 define Package
/softethervpn5-bridge
/description
66 $(call Package
/softethervpn5
/Default
/description
)
68 Provides the vpnbridge
(daemon
).
71 define Package
/softethervpn5-client
72 $(call Package
/softethervpn5
/Default
)
74 DEPENDS
:= +softethervpn5-libs
76 define Package
/softethervpn5-client
/description
77 $(call Package
/softethervpn5
/Default
/description
)
79 Provides the vpnclient.
83 # BUG: outdated host/include/elf.h
84 HOST_CFLAGS
+= $(FPIC
) -DAT_HWCAP2
=26
85 TARGET_CFLAGS
+= $(FPIC
)
86 CMAKE_OPTIONS
+= -DICONV_LIB_PATH
="$(ICONV_PREFIX)/lib"
88 # static build for host (hamcorebuilder), avoid -fpic on ncurses/host and shared libs can't be found on host
90 $(Host
/Prepare
/Default
)
91 $(SED
) 's,SHARED,STATIC,g' $(HOST_BUILD_DIR
)/src
/Mayaqua
/CMakeLists.txt
92 $(SED
) 's,SHARED,STATIC,g' $(HOST_BUILD_DIR
)/src
/Cedar
/CMakeLists.txt
93 $(SED
) 's,readline,libreadline.a,g' $(HOST_BUILD_DIR
)/src
/Cedar
/CMakeLists.txt
94 $(SED
) 's,libsodium REQUIRED,libsodium,g' $(HOST_BUILD_DIR
)/src
/Cedar
/CMakeLists.txt
98 $(call Host
/Compile
/Default
,hamcorebuilder
)
102 $(INSTALL_DIR
) $(STAGING_DIR_HOSTPKG
)/bin
/
103 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/src
/hamcorebuilder
/hamcorebuilder
$(STAGING_DIR_HOSTPKG
)/bin
/
106 # disable SSE detection, disables BLAKE2 lib
108 $(call Build
/Prepare
/Default
)
109 $(SED
) 's,cmake_host_system_information,#cmake_host_system_information,g' $(PKG_BUILD_DIR
)/src
/Cedar
/CMakeLists.txt
113 $(call Build
/Compile
/Default
,vpnserver vpnbridge vpnclient vpncmd hamcore-archive-build
)
116 define Package
/softethervpn5-libs
/install
117 $(INSTALL_DIR
) $(1)/usr
/lib
118 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libcedar.so
$(1)/usr
/lib
/
119 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libmayaqua.so
$(1)/usr
/lib
/
120 $(INSTALL_DIR
) $(1)/usr
/libexec
/softethervpn
121 $(CP
) $(PKG_INSTALL_DIR
)/usr
/libexec
/softether
/vpncmd
/hamcore.se2
$(1)/usr
/libexec
/softethervpn
/
122 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/libexec
/softether
/vpncmd
/vpncmd
$(1)/usr
/libexec
/softethervpn
/
123 $(INSTALL_DIR
) $(1)/usr
/bin
124 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/bin
/list_cpu_features
]; then \
125 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/list_cpu_features
$(1)/usr
/bin
/ ; fi
126 $(INSTALL_BIN
) files
/launcher.sh
$(1)/usr
/libexec
/softethervpn
/
127 $(INSTALL_DATA
) files
/dummy
$(1)/usr
/libexec
/softethervpn
/lang.config
128 $(INSTALL_DIR
) $(1)/usr
/bin
129 $(LN
) ..
/..
/usr
/libexec
/softethervpn
/launcher.sh
$(1)/usr
/bin
/vpncmd
132 define Package
/softethervpn5-server
/install
133 $(INSTALL_DIR
) $(1)/usr
/libexec
/softethervpn
134 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/libexec
/softether
/vpnserver
/vpnserver
$(1)/usr
/libexec
/softethervpn
/
135 $(INSTALL_DATA
) files
/dummy
$(1)/usr
/libexec
/softethervpn
/vpn_server.config
136 $(INSTALL_DIR
) $(1)/etc
/init.d
137 $(INSTALL_BIN
) files
/vpnserver.init
$(1)/etc
/init.d
/softethervpnserver
140 define Package
/softethervpn5-bridge
/install
141 $(INSTALL_DIR
) $(1)/usr
/libexec
/softethervpn
142 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/libexec
/softether
/vpnbridge
/vpnbridge
$(1)/usr
/libexec
/softethervpn
/
143 $(INSTALL_DATA
) files
/dummy
$(1)/usr
/libexec
/softethervpn
/vpn_bridge.config
144 $(INSTALL_DIR
) $(1)/etc
/init.d
145 $(INSTALL_BIN
) files
/vpnbridge.init
$(1)/etc
/init.d
/softethervpnbridge
148 define Package
/softethervpn5-client
/install
149 $(INSTALL_DIR
) $(1)/usr
/libexec
/softethervpn
150 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/libexec
/softether
/vpnclient
/vpnclient
$(1)/usr
/libexec
/softethervpn
/
151 $(INSTALL_DATA
) files
/dummy
$(1)/usr
/libexec
/softethervpn
/vpn_client.config
152 $(INSTALL_DIR
) $(1)/etc
/init.d
153 $(INSTALL_BIN
) files
/vpnclient.init
$(1)/etc
/init.d
/softethervpnclient
156 define Package
/softethervpn5-server
/conffiles
157 /usr
/libexec
/softethervpn
/vpn_server.config
158 /usr
/libexec
/softethervpn
/lang.config
161 define Package
/softethervpn5-bridge
/conffiles
162 /usr
/libexec
/softethervpn
/vpn_bridge.config
163 /usr
/libexec
/softethervpn
/lang.config
166 define Package
/softethervpn5-client
/conffiles
167 /usr
/libexec
/softethervpn
/vpn_client.config
168 /usr
/libexec
/softethervpn
/lang.config
171 $(eval
$(call HostBuild
))
172 $(eval
$(call BuildPackage
,softethervpn5-libs
))
173 $(eval
$(call BuildPackage
,softethervpn5-server
))
174 $(eval
$(call BuildPackage
,softethervpn5-bridge
))
175 $(eval
$(call BuildPackage
,softethervpn5-client
))