Commit 2938fae3 authored by Boris Glimcher's avatar Boris Glimcher Committed by Jim Harris
Browse files

scripts/pkgdep: Remove support for rocky|centos|rhel 8



Change-Id: I27ab68b9a2335ffb3f006700f424dbd500f64520
Signed-off-by: default avatarBoris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26551


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz@tzawadzki.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Reviewed-by: default avatarMichal Berger <michal.berger@nutanix.com>
parent 8d7f1929
Loading
Loading
Loading
Loading
+8 −45
Original line number Diff line number Diff line
@@ -26,31 +26,25 @@ disclaimer() {
			sub() { subscription-manager "$@" || :; }
			;;
		rocky)
			[[ $VERSION_ID == 8* ]] || return 0
			yum() { "$(type -P yum)" --setopt=skip_if_unavailable=True "$@"; }
			;;
	esac
}

is_repo() { yum repolist --all | grep -q "^$1"; }

disclaimer

# First, add extra EPEL, ELRepo, Ceph repos to have a chance of covering most of the packages
# on the enterprise systems, like RHEL.
if [[ $ID == centos || $ID == rhel || $ID == rocky ]]; then
	repos=() enable=("epel" "elrepo" "elrepo-testing") add=()
	repos=() enable=("epel" "elrepo" "elrepo-testing")
	if [[ $VERSION_ID == 7* ]]; then
		printf 'Not supported distribution detected (%s):(%s), aborting\n' "$ID" "$VERSION_ID" >&2
		exit 1
	fi

	if [[ $VERSION_ID == 8* ]]; then
		repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm")
		repos+=("https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm")
		add+=("https://packages.daos.io/v2.0/EL8/packages/x86_64/daos_packages.repo")
		enable+=("daos-packages")
		[[ $ID == centos ]] && enable+=("extras")
		printf 'Not supported distribution detected (%s):(%s), aborting\n' "$ID" "$VERSION_ID" >&2
		exit 1
	fi

	if [[ $VERSION_ID == 9* ]]; then
@@ -67,43 +61,29 @@ if [[ $ID == centos || $ID == rhel || $ID == rocky ]]; then
		[[ $ID == centos ]] && enable+=("extras-common")
	fi

	# Add PowerTools needed for install CUnit-devel
	if [[ ($ID == centos || $ID == rocky) && $VERSION_ID =~ ^[89].* ]]; then
		is_repo "PowerTools" && enable+=("PowerTools")
		is_repo "powertools" && enable+=("powertools")
	# Add ceph
	if [[ ($ID == centos || $ID == rocky) && $VERSION_ID == 9* ]]; then
		repos+=("centos-release-ceph-pacific.noarch")
		enable+=("centos-ceph-pacific")
	fi

	[[ $ID == rhel && $VERSION_ID == 8* ]] && repos+=("https://download.ceph.com/rpm-pacific/el8/noarch/ceph-release-1-1.el8.noarch.rpm")
	[[ $ID == rhel && $VERSION_ID == 9* ]] && repos+=("https://download.ceph.com/rpm-reef/el9/noarch/ceph-release-1-1.el9.noarch.rpm")

	if [[ $ID == rocky ]]; then
		enable+=("devel" "extras")
	fi

	if ((${#add[@]} > 0)); then
		yum install -y yum-utils
		for _repo in "${add[@]}"; do
			yum-config-manager --add-repo "$_repo"
		done
	fi

	if ((${#repos[@]} > 0)); then
		yum install -y "${repos[@]}" yum-utils
		yum-config-manager --enable "${enable[@]}"
	fi
	# Potential dependencies can be needed from other RHEL repos, enable them
	if [[ $ID == rhel ]]; then
		[[ $VERSION_ID == 8* ]] && sub repos --enable codeready-builder-for-rhel-8-x86_64-rpms
		[[ $VERSION_ID == 9* ]] && sub repos --enable codeready-builder-for-rhel-9-x86_64-rpms
	fi
	[[ $ID == rhel && $VERSION_ID == 9* ]] && sub repos --enable codeready-builder-for-rhel-9-x86_64-rpms
fi

yum install -y gcc gcc-c++ make CUnit-devel libaio-devel openssl-devel \
	libuuid-devel ncurses-devel json-c-devel libcmocka-devel \
	clang clang-devel python3-pip unzip keyutils keyutils-libs-devel fuse3-devel patchelf \
	pkgconfig
	pkgconfig python python3-devel

[[ $VERSION_ID != 10* ]] && yum install -y libiscsi-devel

@@ -122,21 +102,6 @@ if [ "$(uname -m)" = "aarch64" ]; then
	fi
fi

if echo "$ID $VERSION_ID" | grep -E -q 'centos 8|rhel 8|rocky 8'; then
	yum install -y python36 python36-devel
	#Create hard link to use in SPDK as python
	if [[ ! -e /usr/bin/python && -e /etc/alternatives/python3 ]]; then
		ln -s /etc/alternatives/python3 /usr/bin/python
	fi
	# pip3, which is shipped with centos8 and rocky8, is currently providing faulty ninja binary
	# which segfaults at each run. To workaround it, upgrade pip itself and then use it for each
	# package - new pip will provide ninja at the same version but with the actually working
	# binary.
	pip3 install --upgrade pip
	pip3() { /usr/local/bin/pip "$@"; }
else
	yum install -y python python3-devel
fi
pip3 install ninja
pip3 install meson
pip3 install pyelftools
@@ -161,9 +126,7 @@ if [[ $INSTALL_DEV_TOOLS == "true" ]]; then
	# Tools for developers
	devtool_pkgs=(git sg3_utils pciutils libabigail bash-completion ruby-devel)

	if echo "$ID $VERSION_ID" | grep -E -q 'centos 8|rocky 8'; then
		devtool_pkgs+=(python3-pycodestyle astyle)
	elif echo "$ID $VERSION_ID" | grep -E -q 'rocky 10'; then
	if echo "$ID $VERSION_ID" | grep -E -q 'rocky 10'; then
		echo "Rocky 10 do not have python3-pycodestyle and lcov dependencies"
		devtool_pkgs+=(astyle ShellCheck)
	elif [[ $ID == openeuler ]]; then