From 1eda1f7aa81356399837ece08373823fb14d8be4225c5f387d3312bdeaf03310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Tue, 7 Jan 2025 09:59:56 +0000 Subject: [PATCH] make misuses of %global with %buildroot work again OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=684 --- python-rpm.spec | 2 +- rpm.changes | 6 ++++++ rpm.spec | 5 +++-- undefbuildroot.diff | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 undefbuildroot.diff diff --git a/python-rpm.spec b/python-rpm.spec index 62aa34f..c3faf6a 100644 --- a/python-rpm.spec +++ b/python-rpm.spec @@ -1,7 +1,7 @@ # # spec file for package python-rpm # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # Copyright (c) 2017 Neal Gompa . # # All modifications and additions to the file contributed by third parties diff --git a/rpm.changes b/rpm.changes index 8a6250e..35e2920 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 7 10:58:17 CET 2025 - mls@suse.de + +- make misuses of %global with %buildroot work again + * new patch: undefbuildroot.diff + ------------------------------------------------------------------- Thu Dec 19 14:29:49 CET 2024 - mls@suse.de diff --git a/rpm.spec b/rpm.spec index 2e80a69..b701289 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,7 +1,7 @@ # # spec file for package rpm # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -123,6 +123,7 @@ Patch150: unshare.diff Patch151: buildroot-symlink.diff Patch152: debugpackage.diff Patch153: nextfiles.diff +Patch154: undefbuildroot.diff Patch6464: auto-config-update-aarch64-ppc64le.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # @@ -237,7 +238,7 @@ rm -rf sqlite %patch -P 140 %endif %patch -P 141 -P 142 -%patch -P 150 -P 151 -P 152 -P 153 +%patch -P 150 -P 151 -P 152 -P 153 -P 154 %ifarch aarch64 ppc64le riscv64 %patch -P 6464 diff --git a/undefbuildroot.diff b/undefbuildroot.diff new file mode 100644 index 0000000..64dbff0 --- /dev/null +++ b/undefbuildroot.diff @@ -0,0 +1,15 @@ +--- build/parseSpec.c.orig 2025-01-07 09:55:58.006136886 +0000 ++++ build/parseSpec.c 2025-01-07 09:56:23.618086661 +0000 +@@ -1321,9 +1321,11 @@ static rpmSpec parseSpec(const char *spe + rpmPushMacroFlags(spec->macros, "_top_builddir", NULL, + top_builddir, RMIL_GLOBAL, RPMMACRO_LITERAL); + +- /* Undefine (!!) %_builddir so %global misuses fall through */ ++ /* Undefine (!!) %_builddir and %buildroot so %global misuses fall through */ + while (rpmMacroIsDefined(spec->macros, "_builddir")) + rpmPopMacro(spec->macros, "_builddir"); ++ while (rpmMacroIsDefined(spec->macros, "buildroot")) ++ rpmPopMacro(spec->macros, "buildroot"); + free(top_builddir); + } +