Conditionalize all macros on %_package_note_file being defined

This way %undefine _package_note_file is a good way to opt-out of the
feature. The other macros wouldn't work without %_package_note_file anyway.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-01-20 20:49:51 +01:00
parent 52ae83790c
commit fb5900700e

View File

@ -3,6 +3,6 @@
# for details.
%_package_note_file %{_builddir}/.package_note-%{name}-%{version}-%{release}.%{_arch}.ld
%_package_note_flags %{?name:-Wl,-dT,%{_package_note_file}}
%_package_note_flags %{?_package_note_file:%{?name:-Wl,-dT,%{_package_note_file}}}
%_generate_package_note_file %{?name: if ! [ -f %{_package_note_file} ] && [ -f %{_rpmconfigdir}/generate-rpm-note.sh ]; then %{_rpmconfigdir}/generate-rpm-note.sh %{name} %{version}-%{release} %{_arch} >%{_package_note_file}; fi}
%_generate_package_note_file %{?_package_note_file:%{?name:if ! [ -f %{_package_note_file} ] && [ -f %{_rpmconfigdir}/generate-rpm-note.sh ]; then %{_rpmconfigdir}/generate-rpm-note.sh %{name} %{version}-%{release} %{_arch} >%{_package_note_file}; fi}}