@@ -4,15 +4,27 @@ function print_msg {
44 echo -e " ${MSG_COLOR} *** $( date) : dependencies_centos.sh | $@ ${NOCOLOR} "
55}
66
7+ function install_dependencies {
8+ print_msg " Installing dependencies"
9+
10+ yum update -y > /dev/null
11+ yum install epel-release -y > /dev/null
12+ yum install https://centos7.iuscommunity.org/ius-release.rpm -y > /dev/null
13+ yum install git which libxml2-devel libxslt-devel libssh-devel libtool gcc-c++ pcre-devel -y > /dev/null
14+ yum install cmake3 wget curl-devel unzip make java sudo -y > /dev/null
15+ yum install python-devel python-pip python36u-devel python36u-pip rpm-build redhat-lsb lcov -y > /dev/null
16+ }
17+
718function check_install_gcc {
19+ print_msg " Checking gcc/g++ installation"
820 which gcc
921 local status=$?
1022 if [[ $status == 0 ]]
1123 then
1224 gcc_version=$( echo $( gcc --version) | awk ' { print $3 }' )
13- print_msg " Current gcc/g++ version is $gcc_version "
25+ print_msg " Current gcc version is $gcc_version "
1426 else
15- print_msg " The gcc/g++ not installed"
27+ print_msg " The gcc not installed"
1628 gcc_version=" 4.0"
1729 fi
1830 if [[ $( echo $gcc_version | cut -d ' .' -f 1) < 5 ]]
@@ -50,8 +62,7 @@ MSG_COLOR=$YELLOW
5062os_info=$( cat /etc/* -release)
5163print_msg " OS info: $os_info "
5264
53- yum install -y epel-release
54- yum install -y libxslt-devel libssh-devel python-devel cmake3 python-pip which make sudo > /dev/null
65+ install_dependencies
5566
5667check_install_gcc
5768
0 commit comments