From: Mr NeilBrown Date: Mon, 12 Dec 2022 04:31:16 +0000 (+1100) Subject: LU-16382 spec: SUSE OBS requires kernel-source requirement. X-Git-Tag: 2.15.56~147 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=9976de28e0119c59b8557df574959bbf85066cc4;p=fs%2Flustre-release.git LU-16382 spec: SUSE OBS requires kernel-source requirement. The SUSE OBS creates a virtual environment containing ONLY the stated BuildRequires requirements, and some defaults. To be able to build ldiskfs we need the kernel source, so we need "BuildRequires: kernel-source". However when contrib/lbuild it is used to build lustre, it finds the source by other means and fails on that BuildRequires. So it must be conditional on running under abuild. (the OBS build tool). When abuild extracts these BuildRequires, it cannot parse %() so conditions using that all appear to be "false". But %() is the only way to detect abuild - but looking in environment. So a dance is needed to fit with all these odd requirements. Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: I2fe9ecaf857ecbd5fda7e857b661b5b756501190 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49365 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre.spec.in b/lustre.spec.in index 870b0e7..696aeca 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -232,6 +232,18 @@ BuildRequires: pkg-config %if %{with gss} BuildRequires: krb5-devel openssl-devel %endif +%if %{with lustre_modules} +# abuild (auto-build) used by SUSE Open Build Service +# need kernel-source as a build requirement, but the code +# which extracts these requirements don't understand %() +# and treats all such as failures. So the following dance +# Allows the requirements to be seen by abuild, but ignored +# by lbuild. +%if "%(echo $USER)" != "abuild" +%else +BuildRequires: kernel-source +%endif +%endif %if %{with servers} Requires: %{name}-osd Requires: %{name}-osd-mount