Whamcloud - gitweb
LU-13906 build: Conditionally require kmod-zfs-devel 56/46356/13
authorShaun Tancheff <shaun.tancheff@hpe.com>
Fri, 6 Oct 2023 08:03:09 +0000 (03:03 -0500)
committerOleg Drokin <green@whamcloud.com>
Sun, 4 Feb 2024 08:26:02 +0000 (08:26 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: Ia12239ac7e3912ff50ec7c8e2ceb888862afbc34
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/46356
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
lustre.spec.in
rpm/kmp-lustre-osd-zfs.preamble

index 987ffec..1c00217 100644 (file)
@@ -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
index b6581b9..115e7d5 100644 (file)
@@ -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}