From 2790a9f91ec3b88c85415b09e0f4235f3986874c Mon Sep 17 00:00:00 2001 From: David Galloway Date: Thu, 30 Jan 2020 09:48:42 -0500 Subject: [PATCH] ceph-build: Update setup_rpm for CentOS8 support Signed-off-by: David Galloway --- ceph-build/build/setup_rpm | 54 ++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/ceph-build/build/setup_rpm b/ceph-build/build/setup_rpm index 601acb94..56618f20 100644 --- a/ceph-build/build/setup_rpm +++ b/ceph-build/build/setup_rpm @@ -30,29 +30,6 @@ cd $(basename *.orig.tar.gz .orig.tar.gz | sed s/_/-/) pwd $SUDO yum install -y yum-utils -if [ "$ARCH" = x86_64 ]; then - $SUDO yum install -y centos-release-scl -elif [ "$ARCH" = arm64 ]; then - $SUDO yum install -y centos-release-scl-rh - $SUDO yum-config-manager --disable centos-sclo-rh - $SUDO yum-config-manager --enable centos-sclo-rh-testing -fi -sed -e 's/@//g' < ceph.spec.in > $DIR/ceph.spec - -# Make sure we have all the rpm macros installed and at the latest version -# before installing the dependencies, python3-devel requires the -# python-rpm-macro we use for identifying the python related dependencies -$SUDO yum install -y python3-devel - -$SUDO yum-builddep -y --setopt=*.skip_if_unavailable=true $DIR/ceph.spec - -BRANCH=`branch_slash_filter $BRANCH` - -if [[ ! -f /etc/redhat-release && ! -f /usr/bin/zypper ]] ; then - exit 0 -fi - -cd $WORKSPACE get_rpm_dist() { LSB_RELEASE=/usr/bin/lsb_release @@ -101,6 +78,37 @@ get_rpm_dist() { get_rpm_dist +if [ "$RELEASE" = 7 ]; then + if [ "$ARCH" = x86_64 ]; then + $SUDO yum install -y centos-release-scl + elif [ "$ARCH" = arm64 ]; then + $SUDO yum install -y centos-release-scl-rh + $SUDO yum-config-manager --disable centos-sclo-rh + $SUDO yum-config-manager --enable centos-sclo-rh-testing + fi +elif [ "$RELEASE" = 8 ]; then + $SUDO dnf config-manager --set-enabled PowerTools + # chacractl is not python3 compatible yet + $SUDO dnf -y install python2 +fi + +sed -e 's/@//g' < ceph.spec.in > $DIR/ceph.spec + +# Make sure we have all the rpm macros installed and at the latest version +# before installing the dependencies, python3-devel requires the +# python-rpm-macro we use for identifying the python related dependencies +$SUDO yum install -y python3-devel + +$SUDO yum-builddep -y --setopt=*.skip_if_unavailable=true $DIR/ceph.spec + +BRANCH=`branch_slash_filter $BRANCH` + +if [[ ! -f /etc/redhat-release && ! -f /usr/bin/zypper ]] ; then + exit 0 +fi + +cd $WORKSPACE + # Normalize variables across rpm/deb builds NORMAL_DISTRO=$DISTRO NORMAL_DISTRO_VERSION=$RELEASE -- 2.39.5