LU-18233 build: check %kernel_module_package_buildreqs
If rpm macro %kernel_module_package_buildreqs is undefined,
building Lustre codes will report the following error:
Dependency tokens must begin with alpha-numeric, '_' or '/':
BuildRequires: %kernel_module_package_buildreqs
However, the real issue is that kernel-rpm-macros or
rpm-build rpm is not installed. And the error should be like:
error: Failed build dependencies:
kernel-rpm-macros is needed by ...
This patch fixes the above issue by checking if the macro
%kernel_module_package_buildreqs is defined before adding it
to BuildRequires so as to avoid the misleading error.
The patch also replaces suse_version with sle_version to get
the correct version value for SLES15 SP3.
Test-Parameters: trivial clientdistro=el9.4 testlist=sanity
Test-Parameters: trivial clientdistro=el8.10 testlist=sanity
Test-Parameters: trivial clientdistro=sles15sp6 \
env=SANITY_EXCEPT="103a 120e" testlist=sanity
Fixes:
037840fb6b ("LU-12899 build: rhel8 not install kernel-rpm-macros")
Fixes:
c39d269f9d ("LU-12214 build: add right kernel detect")
Fixes:
78c681d9f4 ("LU-16207 build: add rpm-build BuildRequires for SLES15 SP3")
Change-Id: I151d93c0c74ab98e6589393a914acf18b5471289
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56403
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>