Build scripts (#133)

* add cmake installation to build scripts

* fix install script

* add wget installation

* fix cmake instalation

* fix package names for Jessie and suse

* try to install libgcrypt11 and libgcrypt20

* add check for apt-get result for libgnutls
This commit is contained in:
Timofey Turenko
2017-05-30 00:09:05 +03:00
committed by GitHub
parent b2e2136079
commit b1c75f77a3

View File

@ -3,13 +3,10 @@
# Do the real building work. This script is executed on build VM and # Do the real building work. This script is executed on build VM and
# requires a working installation of CMake. # requires a working installation of CMake.
# Check if CMake needs to be installed
command -v cmake || install_cmake="cmake"
command -v apt-get command -v apt-get
if [ $? -e 0 ] if [ $? == 0 ]
then then
# DEB-based distro # DEB-based distro
@ -18,23 +15,35 @@ then
sudo apt-get install -y --force-yes dpkg-dev git gcc g++ ncurses-dev bison \ sudo apt-get install -y --force-yes dpkg-dev git gcc g++ ncurses-dev bison \
build-essential libssl-dev libaio-dev perl make libtool libcurl4-openssl-dev \ build-essential libssl-dev libaio-dev perl make libtool libcurl4-openssl-dev \
libpcre3-dev flex tcl libeditline-dev uuid-dev liblzma-dev libsqlite3-dev \ libpcre3-dev flex tcl libeditline-dev uuid-dev liblzma-dev libsqlite3-dev \
sqlite3 liblua5.1 liblua5.1-dev libgnutls30 libgcrypt20 $install_cmake sqlite3 liblua5.1 liblua5.1-dev wget
sudo apt-get install -y --force-yes libgnutls-dev
if [ $? != 0 ]
then
sudo apt-get install -y --force-yes libgnutls28-dev
fi
sudo apt-get install -y --force-yes libgcrypt20
if [ $? != 0 ]
then
sudo apt-get install -y --force-yes libgcrypt11
fi
else else
## RPM-based distro ## RPM-based distro
command -v yum command -v yum
if [ $? -ne 0 ] if [ $? != 0 ]
then then
# We need zypper here # We need zypper here
sudo zypper -n install gcc gcc-c++ ncurses-devel bison glibc-devel libgcc_s1 perl \ sudo zypper -n install gcc gcc-c++ ncurses-devel bison glibc-devel libgcc_s1 perl \
make libtool libopenssl-devel libaio libaio-devel flex libcurl-devel \ make libtool libopenssl-devel libaio libaio-devel flex libcurl-devel \
pcre-devel git wget tcl libuuid-devel \ pcre-devel git wget tcl libuuid-devel \
xz-devel sqlite3 sqlite3-devel pkg-config lua lua-devel \ xz-devel sqlite3 sqlite3-devel pkg-config lua lua-devel \
gnutls gcrypt $install_cmake gnutls
sudo zypper -n install gcrypt
sudo zypper -n install libgcrypt
sudo zypper -n install rpm-build sudo zypper -n install rpm-build
cat /etc/*-release | grep "SUSE Linux Enterprise Server 11" cat /etc/*-release | grep "SUSE Linux Enterprise Server 11"
if [ $? -ne 0 ] if [ $? != 0 ]
then then
sudo zypper -n install libedit-devel sudo zypper -n install libedit-devel
fi fi
@ -43,13 +52,13 @@ else
sudo yum clean all sudo yum clean all
sudo yum install -y --nogpgcheck gcc gcc-c++ ncurses-devel bison glibc-devel \ sudo yum install -y --nogpgcheck gcc gcc-c++ ncurses-devel bison glibc-devel \
libgcc perl make libtool openssl-devel libaio libaio-devel libedit-devel \ libgcc perl make libtool openssl-devel libaio libaio-devel libedit-devel \
libedit-devel libcurl-devel curl-devel systemtap-sdt-devel rpm-sign \ libedit-devel libcurl-devel curl-devel systemtap-sdt-devel rpm-sign wget \
gnupg pcre-devel flex rpmdevtools git wget tcl openssl libuuid-devel xz-devel \ gnupg pcre-devel flex rpmdevtools git wget tcl openssl libuuid-devel xz-devel \
sqlite sqlite-devel pkgconfig lua lua-devel rpm-build createrepo yum-utils \ sqlite sqlite-devel pkgconfig lua lua-devel rpm-build createrepo yum-utils \
gnutls gcrypt $install_cmake gnutls gcrypt
cat /etc/redhat-release | grep "release 5" cat /etc/redhat-release | grep "release 5"
if [ $? -eq 0 ] if [ $? == 0 ]
then then
sudo yum remove -y libedit-devel libedit sudo yum remove -y libedit-devel libedit
fi fi
@ -57,6 +66,27 @@ else
fi fi
# cmake
wget http://max-tst-01.mariadb.com/ci-repository/cmake-3.7.1-Linux-x86_64.tar.gz --no-check-certificate
if [ $? != 0 ] ; then
echo "CMake can not be downloaded from Maxscale build server, trying from cmake.org"
wget https://cmake.org/files/v3.7/cmake-3.7.1-Linux-x86_64.tar.gz --no-check-certificate
fi
sudo tar xzvf cmake-3.7.1-Linux-x86_64.tar.gz -C /usr/ --strip-components=1
cmake_version=`cmake --version | grep "cmake version" | awk '{ print $3 }'`
if [ "$cmake_version" \< "3.7.1" ] ; then
echo "cmake does not work! Trying to build from source"
wget https://cmake.org/files/v3.7/cmake-3.7.1.tar.gz --no-check-certificate
tar xzvf cmake-3.7.1.tar.gz
cd cmake-3.7.1
./bootstrap
gmake
sudo make install
cd ..
fi
# Flex # Flex
wget http://maxscale-jenkins.mariadb.com/x/flex-2.5.35-0.8.el5.rfb.x86_64.rpm wget http://maxscale-jenkins.mariadb.com/x/flex-2.5.35-0.8.el5.rfb.x86_64.rpm
sudo yum install flex-2.5.35-0.8.el5.rfb.x86_64.rpm -y --nogpgcheck sudo yum install flex-2.5.35-0.8.el5.rfb.x86_64.rpm -y --nogpgcheck
@ -67,7 +97,7 @@ mkdir rabbit
cd rabbit cd rabbit
git clone https://github.com/alanxz/rabbitmq-c.git git clone https://github.com/alanxz/rabbitmq-c.git
if [ $? -ne 0 ] if [ $? != 0 ]
then then
echo "Error cloning rabbitmq-c" echo "Error cloning rabbitmq-c"
exit 1 exit 1
@ -84,7 +114,7 @@ mkdir tcl
cd tcl cd tcl
wget --no-check-certificate http://prdownloads.sourceforge.net/tcl/tcl8.6.5-src.tar.gz wget --no-check-certificate http://prdownloads.sourceforge.net/tcl/tcl8.6.5-src.tar.gz
if [ $? -ne 0 ] if [ $? != 0 ]
then then
echo "Error getting tcl" echo "Error getting tcl"
exit 1 exit 1