2017-08-21 16:37:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Please run this script as root.
|
|
|
|
|
|
|
|
SYSTEM=`uname -s`
|
|
|
|
|
2018-08-18 16:25:41 +00:00
|
|
|
scriptsdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $scriptsdir/..)
|
|
|
|
|
2017-08-21 16:37:37 +00:00
|
|
|
if [ -s /etc/redhat-release ]; then
|
|
|
|
# Includes Fedora, CentOS
|
|
|
|
if [ -f /etc/centos-release ]; then
|
|
|
|
# Add EPEL repository for CUnit-devel
|
|
|
|
yum --enablerepo=extras install -y epel-release
|
|
|
|
fi
|
2018-08-14 08:54:30 +00:00
|
|
|
yum install -y gcc gcc-c++ make CUnit-devel libaio-devel openssl-devel \
|
2018-05-17 23:05:24 +00:00
|
|
|
git astyle python-pep8 lcov python clang-analyzer libuuid-devel \
|
2018-08-22 06:52:46 +00:00
|
|
|
sg3_utils libiscsi-devel pciutils
|
2018-07-18 19:08:17 +00:00
|
|
|
# Additional (optional) dependencies for showing backtrace in logs
|
2018-08-07 04:13:36 +00:00
|
|
|
yum install -y libunwind-devel
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for NVMe over Fabrics
|
|
|
|
yum install -y libibverbs-devel librdmacm-devel
|
2017-09-15 23:42:42 +00:00
|
|
|
# Additional dependencies for DPDK
|
2018-06-13 20:14:08 +00:00
|
|
|
yum install -y numactl-devel nasm
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for building docs
|
2018-02-13 15:21:00 +00:00
|
|
|
yum install -y doxygen mscgen graphviz
|
2018-04-03 23:07:39 +00:00
|
|
|
# Additional dependencies for building pmem based backends
|
2017-09-29 08:49:51 +00:00
|
|
|
yum install -y libpmemblk-devel || true
|
2018-03-23 10:40:31 +00:00
|
|
|
# Additional dependencies for SPDK CLI
|
2018-07-05 19:29:06 +00:00
|
|
|
yum install -y python-configshell python-pexpect python3-configshell python3-pexpect
|
2017-08-21 16:37:37 +00:00
|
|
|
elif [ -f /etc/debian_version ]; then
|
|
|
|
# Includes Ubuntu, Debian
|
|
|
|
apt-get install -y gcc g++ make libcunit1-dev libaio-dev libssl-dev \
|
2018-08-22 06:52:46 +00:00
|
|
|
git astyle pep8 lcov clang uuid-dev sg3-utils libiscsi-dev pciutils
|
2018-07-18 19:08:17 +00:00
|
|
|
# Additional (optional) dependencies for showing backtrace in logs
|
|
|
|
apt-get install libunwind-dev
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for NVMe over Fabrics
|
|
|
|
apt-get install -y libibverbs-dev librdmacm-dev
|
2017-09-15 23:42:42 +00:00
|
|
|
# Additional dependencies for DPDK
|
2018-06-13 20:14:08 +00:00
|
|
|
apt-get install -y libnuma-dev nasm
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for building docs
|
2018-02-13 15:21:00 +00:00
|
|
|
apt-get install -y doxygen mscgen graphviz
|
2018-03-23 10:40:31 +00:00
|
|
|
# Additional dependencies for SPDK CLI
|
2018-07-05 19:29:06 +00:00
|
|
|
apt-get install -y python-pip python3-pip
|
|
|
|
pip install configshell_fb pexpect
|
|
|
|
pip3 install configshell_fb pexpect
|
2018-04-24 20:23:48 +00:00
|
|
|
elif [ -f /etc/SuSE-release ]; then
|
|
|
|
zypper install -y gcc gcc-c++ make cunit-devel libaio-devel libopenssl-devel \
|
2018-08-22 06:52:46 +00:00
|
|
|
git-core lcov python-base python-pep8 libuuid-devel sg3_utils pciutils
|
2018-07-18 19:08:17 +00:00
|
|
|
# Additional (optional) dependencies for showing backtrace in logs
|
|
|
|
zypper install libunwind-devel
|
2018-04-24 20:23:48 +00:00
|
|
|
# Additional dependencies for NVMe over Fabrics
|
|
|
|
zypper install -y rdma-core-devel
|
|
|
|
# Additional dependencies for DPDK
|
2018-06-13 20:14:08 +00:00
|
|
|
zypper install -y libnuma-devel nasm
|
2018-05-24 20:03:27 +00:00
|
|
|
# Additional dependencies for building pmem based backends
|
2018-04-24 20:23:48 +00:00
|
|
|
zypper install -y libpmemblk-devel
|
|
|
|
# Additional dependencies for building docs
|
|
|
|
zypper install -y doxygen mscgen graphviz
|
2017-08-21 16:37:37 +00:00
|
|
|
elif [ $SYSTEM = "FreeBSD" ] ; then
|
2018-06-21 19:29:12 +00:00
|
|
|
pkg install -y gmake cunit openssl git devel/astyle bash py27-pycodestyle \
|
2018-06-13 20:14:08 +00:00
|
|
|
python misc/e2fsprogs-libuuid sysutils/sg3_utils nasm
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for building docs
|
2018-06-21 19:29:12 +00:00
|
|
|
pkg install -y doxygen mscgen graphviz
|
2017-08-21 16:37:37 +00:00
|
|
|
else
|
|
|
|
echo "pkgdep: unknown system type."
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-08-18 16:25:41 +00:00
|
|
|
|
|
|
|
# Only crypto needs nasm and this lib but because the lib requires root to
|
|
|
|
# install we do it here.
|
|
|
|
nasm_ver=$(nasm -v | sed 's/[^0-9]*//g' | awk '{print substr ($0, 0, 5)}')
|
|
|
|
if [[ $nasm_ver -lt "21202" ]]; then
|
|
|
|
echo Crypto requires NASM version 2.12.02 or newer. Please install
|
|
|
|
echo or upgrade and re-run this script if you are going to use Crypto.
|
|
|
|
else
|
|
|
|
ipsec="$(find /usr -name intel-ipsec-mb.h 2>/dev/null)"
|
|
|
|
if [[ "$ipsec" == "" ]]; then
|
|
|
|
if [[ -d "$rootdir/intel-ipsec-mb" ]]; then
|
|
|
|
cd $rootdir/intel-ipsec-mb
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
cd -
|
|
|
|
else
|
|
|
|
echo "The intel-ipsec-mb submodule has not been cloned and will not be installed."
|
|
|
|
echo "To enable crypto, run 'git submodule update --init' and then run this script again."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|