treewide: remove AUTORELEASE
[feed/packages.git] / net / softethervpn5 / Makefile
1 # Based partially on the versions of el1n and Federico Di Marco
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=softethervpn5
6 PKG_VERSION:=5.02.5180
7 PKG_RELEASE:=3
8
9 PKG_LICENSE:=GPL-2.0
10 PKG_LICENSE_FILES:=COPYING
11
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
15
16 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/SoftEtherVPN-$(PKG_VERSION)
17 PKG_BUILD_DIR:=$(BUILD_DIR)/SoftEtherVPN-$(PKG_VERSION)
18
19 HOST_BUILD_DEPENDS:=ncurses/host readline/host
20 PKG_BUILD_DEPENDS:=softethervpn5/host
21
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
26
27 define Package/softethervpn5/Default
28 SECTION:=net
29 CATEGORY:=Network
30 SUBMENU:=VPN
31 TITLE:=softethervpn5 v$(PKG_VERSION)
32 URL:=http://www.softether.org/
33 endef
34
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/
40 endef
41
42 define Package/softethervpn5-libs
43 $(call Package/softethervpn5/Default)
44 DEPENDS:=+libsodium +libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
45 TITLE+= libs
46 HIDDEN:=1
47 endef
48
49 define Package/softethervpn5-server
50 $(call Package/softethervpn5/Default)
51 TITLE+= server
52 DEPENDS:= +softethervpn5-libs
53 endef
54 define Package/softethervpn5-server/description
55 $(call Package/softethervpn5/Default/description)
56
57 Provides the vpnserver (daemon).
58 endef
59
60 define Package/softethervpn5-bridge
61 $(call Package/softethervpn5/Default)
62 TITLE+= bridge
63 DEPENDS:= +softethervpn5-libs
64 endef
65 define Package/softethervpn5-bridge/description
66 $(call Package/softethervpn5/Default/description)
67
68 Provides the vpnbridge (daemon).
69 endef
70
71 define Package/softethervpn5-client
72 $(call Package/softethervpn5/Default)
73 TITLE+= client
74 DEPENDS:= +softethervpn5-libs
75 endef
76 define Package/softethervpn5-client/description
77 $(call Package/softethervpn5/Default/description)
78
79 Provides the vpnclient.
80 endef
81
82 export USE_MUSL=YES
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"
87
88 # static build for host (hamcorebuilder), avoid -fpic on ncurses/host and shared libs can't be found on host
89 define Host/Prepare
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
95 endef
96
97 define Host/Compile
98 $(call Host/Compile/Default,hamcorebuilder)
99 endef
100
101 define Host/Install
102 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
103 $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/hamcorebuilder/hamcorebuilder $(STAGING_DIR_HOSTPKG)/bin/
104 endef
105
106 # disable SSE detection, disables BLAKE2 lib
107 define Build/Prepare
108 $(call Build/Prepare/Default)
109 $(SED) 's,cmake_host_system_information,#cmake_host_system_information,g' $(PKG_BUILD_DIR)/src/Cedar/CMakeLists.txt
110 endef
111
112 define Build/Compile
113 $(call Build/Compile/Default,vpnserver vpnbridge vpnclient vpncmd hamcore-archive-build)
114 endef
115
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
130 endef
131
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
138 endef
139
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
146 endef
147
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
154 endef
155
156 define Package/softethervpn5-server/conffiles
157 /usr/libexec/softethervpn/vpn_server.config
158 /usr/libexec/softethervpn/lang.config
159 endef
160
161 define Package/softethervpn5-bridge/conffiles
162 /usr/libexec/softethervpn/vpn_bridge.config
163 /usr/libexec/softethervpn/lang.config
164 endef
165
166 define Package/softethervpn5-client/conffiles
167 /usr/libexec/softethervpn/vpn_client.config
168 /usr/libexec/softethervpn/lang.config
169 endef
170
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))