xref: /spdk/scripts/pkgdep/rhel.sh (revision ba23cec1820104cc710ad776f0127e1cf82033aa)
1#!/usr/bin/env bash
2
3# Minimal install
4if echo "$ID $VERSION_ID" | grep -E -q 'centos 8'; then
5	# Add PowerTools needed for install CUnit-devel in Centos8
6	yum install -y yum-utils
7	yum config-manager --set-enabled PowerTools
8fi
9yum install -y gcc gcc-c++ make CUnit-devel libaio-devel openssl-devel \
10	libuuid-devel libiscsi-devel ncurses-devel
11if echo "$ID $VERSION_ID" | grep -E -q 'centos 8'; then
12	yum install -y python36
13	#Create hard link to use in SPDK as python
14	ln /etc/alternatives/python3 /usr/bin/python || true
15else
16	yum install -y python
17fi
18yum install -y python3-pip
19pip-3 install ninja
20pip-3 install meson
21
22# Additional dependencies for SPDK CLI - not available in rhel and centos
23if ! echo "$ID $VERSION_ID" | grep -E -q 'rhel 7|centos 7'; then
24	yum install -y python3-configshell python3-pexpect
25fi
26# Additional dependencies for ISA-L used in compression
27yum install -y autoconf automake libtool help2man
28# Additional dependencies for DPDK
29yum install -y numactl-devel nasm
30if [[ $INSTALL_DEV_TOOLS == "true" ]]; then
31	# Tools for developers
32	# Includes Fedora, CentOS 7, RHEL 7
33	# Add EPEL repository for CUnit-devel
34	if echo "$ID $VERSION_ID" | grep -E -q 'rhel 7|centos 7|centos 8'; then
35		if ! rpm --quiet -q epel-release; then
36			yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
37		fi
38
39		if [[ $ID = 'rhel' ]]; then
40			subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
41		elif [[ $ID = 'centos' ]]; then
42			yum --enablerepo=extras install -y epel-release
43		fi
44	fi
45	if echo "$ID $VERSION_ID" | grep -E -q 'centos 8'; then
46		yum install -y python3-pycodestyle
47		echo "Centos 8 does not have lcov and ShellCheck dependencies"
48	else
49		yum install -y python-pycodestyle lcov ShellCheck
50	fi
51	yum install -y git astyle sg3_utils pciutils
52	install_shfmt
53fi
54if [[ $INSTALL_PMEM == "true" ]]; then
55	# Additional dependencies for building pmem based backends
56	yum install -y libpmemblk-devel || true
57fi
58if [[ $INSTALL_FUSE == "true" ]]; then
59	# Additional dependencies for FUSE and NVMe-CUSE
60	yum install -y fuse3-devel
61fi
62if [[ $INSTALL_RDMA == "true" ]]; then
63	# Additional dependencies for RDMA transport in NVMe over Fabrics
64	yum install -y libibverbs-devel librdmacm-devel
65fi
66if [[ $INSTALL_DOCS == "true" ]]; then
67	# Additional dependencies for building docs
68	yum install -y mscgen || echo "Warning: couldn't install mscgen via yum. Please install mscgen manually."
69	yum install -y doxygen graphviz
70fi
71