From cc7b19279ad4ce28a0b94a920e07d9bde5d356ef Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Tue, 27 Feb 2024 16:38:48 +0530 Subject: [PATCH] [CI:BUILD] rpm: Make BuildRequires independent of the environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The spec file had %if %{defined rhel} && 0%{?rhel} < 10 %define gobuild(o:) ... %endif ... %if !%{defined gobuild} BuildRequires: go-rpm-macros %endif The intent apparently was to use BR:go-rpm-macros where available, and define %gobuild as a fallback where they are not available. This was unreliable, because the package may have been installed already, and then %gobuild would be defined when the srpm was being built, and then the srpm would NOT have the BR. Instead, use the same condition to wrap the definition of %gobuild and the BR lines to that the BR is always emitted when appropriate. From: Zbigniew Jędrzejewski-Szmek This is a copy-paste of commit be971d6fb in podman fedora dist-git. [NO NEW TESTS NEEDED] Signed-off-by: Lokesh Mandvekar --- rpm/podman.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm/podman.spec b/rpm/podman.spec index 62ca4dce9f..2f0cc734c3 100644 --- a/rpm/podman.spec +++ b/rpm/podman.spec @@ -81,7 +81,7 @@ BuildRequires: glibc-devel BuildRequires: glibc-static BuildRequires: golang BuildRequires: git-core -%if !%{defined gobuild} +%if %{undefined rhel} || 0%{?rhel} >= 10 BuildRequires: go-rpm-macros %endif BuildRequires: gpgme-devel