From 77d01c485e00468b2ef6e3eb64544d30c049a411 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Fri, 6 Oct 2023 03:03:09 -0500 Subject: [PATCH] LU-13906 build: Conditionally require kmod-zfs-devel Server with zfs support requires either kmod-zfs-devel or a configure that points to the required headers and library files via configure. Here we check the configure arguments for '--with-zfs-obj=' if the zfs path is specified for configure the package requirement is not needed. Otherwise require the kmod-zfs-devel package and require one of libzfs-devel, libzfs4-devel or libzfs5-devel HPE-bug-id: LUS-9743, LUS-10363 Test-Parameters: trivial Signed-off-by: Shaun Tancheff Change-Id: Ia12239ac7e3912ff50ec7c8e2ceb888862afbc34 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/46356 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Reviewed-by: Olaf Faaland --- lustre.spec.in | 8 ++++++++ rpm/kmp-lustre-osd-zfs.preamble | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/lustre.spec.in b/lustre.spec.in index 987ffec..1c00217 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -373,6 +373,7 @@ lustre tools (mount/mkfs) to provide support for ldisfs %endif %if %{with zfs} +%global confzfsdobjpath %(echo '%configure_args' | grep -q -- --with-zfs-obj= ; echo $?) %kernel_module_package -n %{name}-osd-zfs -p %SOURCE5 -f %SOURCE6 %{_flavor} %if %{with lustre_utils} %package osd-zfs-mount @@ -380,9 +381,16 @@ Summary: Lustre mount's zfs-specific helper library BuildRequires: pkgconfig(mount) Provides: %{name}-osd-mount = %{version} Obsoletes: lustre-osd-mount < %{version} +%if 0%{confzfsdobjpath} != 0 +BuildRequires: (libzfs-devel or libzfs4-devel or libzfs5-devel) +%endif +# end confzfsdobjpath # Tests also require zpool from zfs package: Requires: zfs Requires: %{requires_kmod_osd_zfs_name} +Provides: %{name}-osd-mount = %{version} +Provides: %{name}-osd-zfs-mount = %{version} +Requires: %{name}-osd-zfs = %{version} %description osd-zfs-mount Provide a shared library (dso) that can be loaded into various diff --git a/rpm/kmp-lustre-osd-zfs.preamble b/rpm/kmp-lustre-osd-zfs.preamble index b6581b9..115e7d5 100644 --- a/rpm/kmp-lustre-osd-zfs.preamble +++ b/rpm/kmp-lustre-osd-zfs.preamble @@ -4,5 +4,9 @@ License: GPL-2.0-only Requires: kernel-%1 %endif Requires: %{name}-osd-zfs-mount = %{version} +%if 0%{confzfsdobjpath} != 0 +BuildRequires: kmod-zfs-devel +%endif Provides: %{name}-osd = %{version} +Provides: %{name}-osd-zfs = %{version} Obsoletes: %{name}-osd-zfs < %{version} -- 1.8.3.1