From 875ccefcdb241e793e6ee6123d44c1a9346f5f8f Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Sun, 16 Jan 2022 17:10:31 +0000 Subject: [PATCH] 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 Change-Id: I1534e224cdfc166061a166ceef18261eef2d8cd8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11135 Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- rpmbuild/rpm.sh | 6 ++++++ rpmbuild/spdk.spec | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/rpmbuild/rpm.sh b/rpmbuild/rpm.sh index 3773c5e99..8e2e3f48c 100755 --- a/rpmbuild/rpm.sh +++ b/rpmbuild/rpm.sh @@ -112,6 +112,12 @@ build_macros() { 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 macros+=(-D "libdir $(get_config libdir print)") fi diff --git a/rpmbuild/spdk.spec b/rpmbuild/spdk.spec index f4cc78939..107de827d 100644 --- a/rpmbuild/spdk.spec +++ b/rpmbuild/spdk.spec @@ -8,6 +8,7 @@ %{!?requirements:%define requirements 0} %{!?build_requirements:%define build_requirements 0} %{!?shared:%define shared 0} +%{!?rbd:%define rbd 0} %{!?libdir:%define libdir /usr/local/lib} %{!?vfio_user:%define vfio_user 0} @@ -76,7 +77,11 @@ cl() { } %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 # Rely mainly on CONFIG