-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·118 lines (105 loc) · 3.72 KB
/
install
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
if [ "$machine" = "Mac" ]; then
brew upgrade openssl
brew link --force openssl
pkg-config --modversion openssl
brew install cmake
brew install autoconf automake libtool boost unzip make wget
xcode-select --install
sudo cp -rf /usr/local/Cellar/openssl/1.0.2s/lib/* /usr/local/lib/
sudo cp -rf /usr/local/Cellar/openssl/1.0.2s/include/* /usr/local/include/openssl
fi
sudo rm -rf install
mkdir install
cd install
export MYSQL_VERSION=8.0.18
export MYSQL_CON_VERSION=8.0.18
export GRPC_VERSION=v1.24.x
export PROTO_VERSION=3.10.0
export OPENSSL_VERSION=1.1.1
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
if [ "$machine" = "Mac" ]; then
export MYSQL_PLATFORM=macos10.14
export MYSQL_EXTENSION=tar.gz
export MYSQL_EXTRACT_COMMAND=xvzf
echo ${machine}
elif [ "$machine" = "Linux" ]; then
export MYSQL_PLATFORM=linux-glibc2.12
export MYSQL_EXTENSION=tar.xz
export MYSQL_EXTRACT_COMMAND=xf
echo ${machine}
fi
if [ "$machine" = "Linux" ]; then
sudo apt-get -y install g++
sudo apt-get -y install build-essential
sudo apt-get -y install autotools-dev
sudo apt-get -y install automake
sudo apt-get -y install autoconf
sudo apt-get -y install cmake
sudo apt-get -y install libboost-all-dev
sudo apt-get -y install libssl-dev
sudo apt-get -y install libncurses5-dev libncursesw5-dev
sudo apt-get -y install libtool
sudo apt-get -y install curl
sudo apt-get -y install openssl libssl-dev
sudo apt-get -y install zlib1g-dev
curl https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz | tar xz && cd openssl-$OPENSSL_VERSION && sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl no-shared && sudo make && sudo make install
fi
cd ..
rm -rf protobuf-$PROTO_VERSION
wget https://github.com/protocolbuffers/protobuf/releases/download/v$PROTO_VERSION/protobuf-all-$PROTO_VERSION.tar.gz --no-check-certificate
tar -xvzf protobuf-all-$PROTO_VERSION.tar.gz
cd protobuf-$PROTO_VERSION
./configure
make
sudo make install
sudo ldconfig
# Build gRPC
cd ..
rm -rf grpc
git clone -b $GRPC_VERSION https://github.com/grpc/grpc && \
cd grpc && \
git submodule update --init && \
make && \
sudo make install
cd ..
rm rf yaml-cpp
git clone https://github.com/jbeder/yaml-cpp.git && \
cd yaml-cpp && \
mkdir build && \
cd build && \
cmake .. && \
make && \
sudo make install
cd ..
cd ..
rm -rf cpp_redis
git clone https://github.com/cpp-redis/cpp_redis.git && \
cd cpp_redis && \
git submodule init && git submodule update && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make && \
sudo make install
cd ..
cd ..
rm -rf mysql-connector-cpp
git clone https://github.com/mysql/mysql-connector-cpp.git && \
cd mysql-connector-cpp && \
git submodule update --init && \
mkdir build && \
cd build && \
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-$MYSQL_VERSION-$MYSQL_PLATFORM-x86_64.$MYSQL_EXTENSION --no-check-certificate
tar -$MYSQL_EXTRACT_COMMAND mysql-$MYSQL_VERSION-$MYSQL_PLATFORM-x86_64.$MYSQL_EXTENSION
sudo cp -rf mysql-$MYSQL_VERSION-$MYSQL_PLATFORM-x86_64/include/* /usr/local/include/ && \
sudo cp -rf mysql-$MYSQL_VERSION-$MYSQL_PLATFORM-x86_64/lib/* /usr/local/lib/ && \
cmake -DMYSQL_CXXFLAGS=-stdlib=libc++ -DCMAKE_INSTALL_LIBDIR=/usr/local/lib/ -DWITH_SSL=/usr/local -DMYSQL_LIB_DIR=mysql-${MYSQL_VERSION}-$MYSQL_PLATFORM-x86_64/lib -DMYSQL_INCLUDE_DIR=mysql-${MYSQL_VERSION}-$MYSQL_PLATFORM-x86_64/include -DCMAKE_BUILD_TYPE=Release -DWITH_JDBC=TRUE -DBUILD_STATIC=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr/local .. && \
make && \
sudo make install