The default location of kfabric is either
/usr/src/kfabric
or
/usr/src/cray-kfabric
Check for either during rpmbuild --with kfi
Test-Parameters: trivial
HPE-bug-id: LUS-12160
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: Ibcd21335d554b66ec925619c60e61f87d79be63d
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54097
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
# mpi
%endif
+# kfabric can be either cray-kfabric or kfabric
+WITH_KFI=""
+%if %{with kfi}
+ for kfabric in cray-kfabric kfabric
+ do
+ path=/usr/src/${kfabric}/default/Module.symvers
+ if [ -f $path ]; then
+ WITH_KFI="--with-kfi=$(dirname $path)"
+ break;
+ fi
+ done
+%endif
+
WITH_O2IB=""
%if %{with mofed}
o2ib_path=$(find -H %{mofed_default_path} -type d -name ofed_scripts | xargs dirname)
%{!?with_systemd:--with-systemdsystemunitdir=no} \
%{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \
%{?with_multiple_lnds:--enable-multiple-lnds} \
- %{?with_kfi:--with-kfi=/usr/src/cray-kfabric/default} \
+ ${WITH_KFI} \
%{?with_gni:--enable-gni} \
${WITH_O2IB} \
%{!?with_l_getsepol:--disable-l_getsepol} \