/
vest_install.sh
63 lines (52 loc) · 1.61 KB
/
vest_install.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
#!/bin/bash
CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "${CWD}" != "${PWD}" ]; then
printf "\\n\\tPlease cd into directory %s to run this script.\\n \\tExiting now.\\n\\n" "${CWD}"
exit 1
fi
BUILD_DIR="${PWD}/build"
CMAKE_BUILD_TYPE=Release
TIME_BEGIN=$( date -u +%s )
INSTALL_PREFIX="/usr/local/vestio"
VERSION=1.2
txtbld=$(tput bold)
bldred=${txtbld}$(tput setaf 1)
txtrst=$(tput sgr0)
create_symlink() {
pushd /usr/local/bin &> /dev/null
ln -sf ../vestio/bin/$1 $1
popd &> /dev/null
}
install_symlinks() {
printf "\\n\\tInstalling Binary Symlinks\\n\\n"
create_symlink "clvest"
create_symlink "vestio-abigen"
create_symlink "vestio-launcher"
create_symlink "vestio-s2wasm"
create_symlink "vestio-wast2wasm"
create_symlink "vestiocpp"
create_symlink "kvestd"
create_symlink "nodvest"
}
if [ ! -d "${BUILD_DIR}" ]; then
printf "\\n\\tError, vest_build.sh has not ran. Please run ./vest_build.sh first!\\n\\n"
exit -1
fi
${PWD}/scripts/clean_old_install.sh
if [ $? -ne 0 ]; then
printf "\\n\\tError occurred while trying to remove old installation!\\n\\n"
exit -1
fi
if ! pushd "${BUILD_DIR}"
then
printf "Unable to enter build directory %s.\\n Exiting now.\\n" "${BUILD_DIR}"
exit 1;
fi
if ! make install
then
printf "\\n\\t>>>>>>>>>>>>>>>>>>>> MAKE installing has exited with the above error.\\n\\n"
exit -1
fi
popd &> /dev/null
install_symlinks
printf "\n\n${bldred}\t \n${txtrst}"