install-deps.sh: install libzbd-devel on RHEL/CentOS8 on demand

just like WITH_SEASTAR, WITH_ZBD is passed to install-deps.sh as an env
var, and it's disabled by default, as libzbd-devel is not yet packaged
in any distro supported by this script. we packaged and uploaded it
to http://apt-mirror.front.sepia.ceph.com/lab-extras/8/ for build test
the libzbd bluestore backend. so "with_zbd" is always false on non-el8
distros. and should only be enabled for upstream "make check" test.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-09-17 14:21:40 +08:00
parent fd1b02a341
commit 6e673cad6d

View File

@ -26,6 +26,8 @@ ARCH=$(uname -m)
function munge_ceph_spec_in {
local with_seastar=$1
shift
local with_zbd=$1
shift
local for_make_check=$1
shift
local OUTFILE=$1
@ -34,6 +36,9 @@ function munge_ceph_spec_in {
if $with_seastar; then
sed -i -e 's/%bcond_with seastar/%bcond_without seastar/g' $OUTFILE
fi
if $with_zbd; then
sed -i -e 's/%bcond_with zbd/%bcond_without zbd/g' $OUTFILE
fi
if $for_make_check; then
sed -i -e 's/%bcond_with make_check/%bcond_without make_check/g' $OUTFILE
fi
@ -267,6 +272,7 @@ if [ x$(uname)x = xFreeBSDx ]; then
exit
else
[ $WITH_SEASTAR ] && with_seastar=true || with_seastar=false
[ $WITH_ZBD ] && with_zbd=true || with_zbd=false
source /etc/os-release
case "$ID" in
debian|ubuntu|devuan|elementary)
@ -334,7 +340,7 @@ else
$SUDO dnf copr enable -y tchaikov/gcc-toolset-9 centos-stream-x86_64
;;
esac
munge_ceph_spec_in $with_seastar $for_make_check $DIR/ceph.spec
munge_ceph_spec_in $with_seastar $with_zbd $for_make_check $DIR/ceph.spec
# for python3_pkgversion macro defined by python-srpm-macros, which is required by python3-devel
$SUDO dnf install -y python3-devel
$SUDO $builddepcmd $DIR/ceph.spec 2>&1 | tee $DIR/yum-builddep.out
@ -346,7 +352,7 @@ else
echo "Using zypper to install dependencies"
zypp_install="zypper --gpg-auto-import-keys --non-interactive install --no-recommends"
$SUDO $zypp_install systemd-rpm-macros rpm-build || exit 1
munge_ceph_spec_in $with_seastar $for_make_check $DIR/ceph.spec
munge_ceph_spec_in $with_seastar false $for_make_check $DIR/ceph.spec
$SUDO $zypp_install $(rpmspec -q --buildrequires $DIR/ceph.spec) || exit 1
;;
*)