Whamcloud - gitweb
LU-18233 build: check %kernel_module_package_buildreqs 03/56403/2
authorJian Yu <yujian@whamcloud.com>
Wed, 18 Sep 2024 23:57:50 +0000 (16:57 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 27 Sep 2024 23:54:46 +0000 (23:54 +0000)
commitf255b0e3136e80ef267ea87c52800263aeffb052
tree3130b314ea691ec774c5d3ee87e21e0f01a277cc
parent24366d89d610490fd94a0c6bb6aa44ca16dc9639
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>
lustre.spec.in