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.)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-01-20 22:00:46 +01:00
parent 30e7d26cb4
commit ce70218eed

6
macros
View File

@ -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