|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +set -e |
| 4 | +if test $(id -u) != 0 ; then |
| 5 | + SUDO=sudo |
| 6 | +fi |
| 7 | +export LC_ALL=C |
| 8 | + |
| 9 | +source /etc/os-release |
| 10 | + |
| 11 | +case "$ID" in |
| 12 | +ubuntu|debian) |
| 13 | + echo "Using apt-get to install dependencies" |
| 14 | + $SUDO apt-get update -y |
| 15 | + $SUDO apt-get install -y build-essential automake libboost-all-dev bison \ |
| 16 | + cmake libncurses5-dev libreadline-dev libperl-dev libssl-dev \ |
| 17 | + libxml2-dev libkrb5-dev flex libpam-dev libreadline-dev libsnappy-dev \ |
| 18 | + libcurl4-openssl-dev |
| 19 | + $SUDO apt-get install -y libboost-dev libboost-all-dev |
| 20 | + case "$VERSION" in |
| 21 | + *Bionic*) |
| 22 | + echo "Install dependencies specific to Ubuntu Bionic" |
| 23 | + ;; |
| 24 | + *Focal*) |
| 25 | + echo "Install dependencies specific to Ubuntu Focal" |
| 26 | + ;; |
| 27 | + *) |
| 28 | + echo "Unknown OS distribution" |
| 29 | + ;; |
| 30 | + esac |
| 31 | + ;; |
| 32 | +centos) |
| 33 | + echo "Using yum to install dependencies" |
| 34 | + $SUDO yum -y install epel-release |
| 35 | + $SUDO yum -y groupinstall "Development Tools" |
| 36 | + $SUDO yum -y install bison ncurses-devel readline-devel perl-devel \ |
| 37 | + openssl-devel cmake libxml2-devel gperf libaio-devel libevent-devel \ |
| 38 | + python-devel ruby-devel tree wget pam-devel snappy-devel libicu \ |
| 39 | + wget strace ltrace gdb rsyslog net-tools openssh-server expect boost \ |
| 40 | + perl-DBI libicu boost-devel initscripts jemalloc-devel libcurl-devel |
| 41 | + ;; |
| 42 | +opensuse*|suse|sles) |
| 43 | + echo "Using zypper to install dependencies" |
| 44 | + $SUDO zypper install -y bison ncurses-devel readline-devel \ |
| 45 | + libopenssl-devel cmake libxml2-devel gperf libaio-devel \ |
| 46 | + libevent-devel python-devel ruby-devel tree wget pam-devel \ |
| 47 | + snappy-devel libicu-devel libboost_system-devel \ |
| 48 | + libboost_filesystem-devel libboost_thread-devel libboost_regex-devel \ |
| 49 | + libboost_date_time-devel libboost_chrono-devel wget strace ltrace gdb \ |
| 50 | + rsyslog net-tools expect perl-DBI libicu boost-devel jemalloc-devel \ |
| 51 | + libcurl-devel gcc gcc-c++ automake libtool |
| 52 | + ;; |
| 53 | +*) |
| 54 | + echo "$ID is unknown, dependencies will have to be installed manually." |
| 55 | + exit 1 |
| 56 | + ;; |
| 57 | +esac |
| 58 | + |
| 59 | +echo "Dependencies have been installed successfully" |
0 commit comments