rpmbuild: improvements for building with rbd

Add librbd and librados install and build dependencies when "with-rbd"
config option is set.

This will be used by the Ceph NVMe-oF gateway.

Signed-off-by: Mykola Golub <mykola.golub@clyso.com>
Change-Id: I1534e224cdfc166061a166ceef18261eef2d8cd8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11135
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Mykola Golub 2022-01-16 17:10:31 +00:00 committed by Tomasz Zawadzki
parent 8a5d487d7e
commit 875ccefcdb
2 changed files with 12 additions and 1 deletions

View File

@ -112,6 +112,12 @@ build_macros() {
fi fi
fi fi
if get_config with-rbd; then
macros+=(-D "rbd 1")
requirements=${requirements:+$requirements, }"librados2, librbd1"
build_requirements=${build_requirements:+$build_requirements, }"librados-devel, librbd-devel"
fi
if get_config libdir has-arg; then if get_config libdir has-arg; then
macros+=(-D "libdir $(get_config libdir print)") macros+=(-D "libdir $(get_config libdir print)")
fi fi

View File

@ -8,6 +8,7 @@
%{!?requirements:%define requirements 0} %{!?requirements:%define requirements 0}
%{!?build_requirements:%define build_requirements 0} %{!?build_requirements:%define build_requirements 0}
%{!?shared:%define shared 0} %{!?shared:%define shared 0}
%{!?rbd:%define rbd 0}
%{!?libdir:%define libdir /usr/local/lib} %{!?libdir:%define libdir /usr/local/lib}
%{!?vfio_user:%define vfio_user 0} %{!?vfio_user:%define vfio_user 0}
@ -76,7 +77,11 @@ cl() {
} }
%if %{deps} %if %{deps}
./scripts/pkgdep.sh --docs --pmem --rdma --uring _PKGDEP_OPTS="--docs --pmem --rdma --uring"
%if %{rbd}
_PKGDEP_OPTS="$_PKGDEP_OPTS --rbd"
%endif
./scripts/pkgdep.sh $_PKGDEP_OPTS
%endif %endif
# Rely mainly on CONFIG # Rely mainly on CONFIG