forked from gost-engine/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gost-build-all.sh
executable file
·64 lines (55 loc) · 2.01 KB
/
gost-build-all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
sudo date
rm -rf build
rm -f bin/gost.1.1.dylib
git checkout master
if [ "$1" = "pull" ]; then
git pull
fi
# Build for Dev version of OpenSSL present in source in $HOME/src/openssl
O_DIR=""
E_DIR=""
P_DIR=""
THRE="-3-"
THREE="${THRE}" USE_DEVEL="True" OPENSSL_DIR=${O_DIR} ENGINESDIR=${E_DIR} ./gost-build-3.sh 2>&1 | tee ossl3m-build.txt
if [ -r build/bin/gost.dylib ]; then
cp build/bin/gost.dylib ${HOME}/openssl-3/lib/engines-3/gost.3.0.dylib
ln -sf ${HOME}/openssl-3/lib/engines-3/gost.3.0.dylib ${HOME}/openssl-3/lib/engines-3/gost.dylib
cp build/bin/gostprov.dylib ${HOME}/openssl-3/lib/ossl-modules/
cp build/bin/gost*sum ${HOME}/openssl-3/bin/
fi
# Build for Macports-installed OpenSSL-3
rm -rf build
O_DIR="/opt/local/libexec/openssl3"
E_DIR="/opt/local/libexec/openssl3/lib/engines-3"
P_DIR="/opt/local/libexec/openssl3/lib/ossl-modules"
THRE="-3m-"
THREE="${THRE}" OPENSSL_DIR=${O_DIR} PROVDIR=${P_DIR} ENGINESDIR=${E_DIR} ./gost-build-3.sh 2>&1 | tee ossl3-build.txt
if [ -r build/bin/gost.dylib ]; then
sudo cp build/bin/gost.dylib ${E_DIR}/gost.3.0.dylib
sudo cp build/bin/gostprov.dylib ${P_DIR}/
sudo ln -sf ${E_DIR}/gost.3.0.dylib ${E_DIR}/gost.dylib
sudo ln -sf ${E_DIR}/gost.dylib /opt/local/lib/engines-3/
sudo ln -sf ${P_DIR}/gostprov.dylib /opt/local/lib/ossl-modules/
sudo cp build/bin/gost*sum /opt/local/bin/
fi
# Build for Macports-installed OpenSSL-1.1.1
git checkout openssl_1_1_1
if [ "$1" = "pull" ]; then
git pull
fi
rm -rf build
O_DIR=/opt/local/libexec/openssl11
E_DIR=/opt/local/libexec/openssl11/lib/engines-1.1
THRE="-"
THREE="${THRE}" OPENSSL_DIR=${O_DIR} ENGINESDIR=${E_DIR} ./gost-build-3.sh 2>&1 | tee ossl111-build.txt
if [ -d /opt/local/libexec/openssl11 ]; then
if [ -r build/bin/gost.dylib ]; then
sudo cp build/bin/gost.1.1.dylib ${E_DIR}/
sudo ln -sf ${E_DIR}/gost.1.1.dylib ${E_DIR}/gost.dylib
sudo ln -sf ${E_DIR}/gost.dylib /opt/local/lib/engines-1.1/
fi
else
echo "OpenSSL-1.1.1 is not installed."
fi
git checkout master