From ce70218eed7284f0e0b18e8c3ad3a457db33ee8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 20 Jan 2022 22:00:46 +0100 Subject: [PATCH] Move package note generation to build preamble We would try to regenerate the file whenever set_build_flags was used. For packages which call %configure multiple times this would mean a few times during build, and also in the build and check preambles. Let's just simplify this and call it only in the build preamble. https://src.fedoraproject.org/rpms/package-notes/pull-request/1 changes %_generate_package_note_file to be unconditional. This means we'll always rewrite the file and will not use a stale version. (But the two fixes are independent, even though they make the most sense together.) --- macros | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/macros b/macros index 9613a9e..e5cb494 100644 --- a/macros +++ b/macros @@ -80,7 +80,6 @@ # been set implicitly at the start of the %%build section. # LT_SYS_LIBRARY_PATH is used by libtool script. %set_build_flags \ - %{?_generate_package_note_file:%{_generate_package_note_file} ; } \ CFLAGS="${CFLAGS:-%{build_cflags}}" ; export CFLAGS ; \ CXXFLAGS="${CXXFLAGS:-%{build_cxxflags}}" ; export CXXFLAGS ; \ FFLAGS="${FFLAGS:-%{build_fflags}}" ; export FFLAGS ; \ @@ -94,7 +93,10 @@ # install phases. # Use "%undefine _auto_set_build_flags" to disable" %_auto_set_build_flags 1 -%__spec_build_pre %{___build_pre} %{?_auto_set_build_flags:%{set_build_flags}} +%__spec_build_pre %{___build_pre} \ + %{?_auto_set_build_flags:%{set_build_flags}} \ + %{?_generate_package_note_file} + %__spec_check_pre %{___build_pre} %{?_auto_set_build_flags:%{set_build_flags}} # Internal-only. Do not use. Expand a variable and strip the flags