From fb5900700e5d58851b3258eb7de3e895485821e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 20 Jan 2022 20:49:51 +0100 Subject: [PATCH] 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. --- macros.package-notes-srpm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros.package-notes-srpm b/macros.package-notes-srpm index 4f6a2e4..ba17ef3 100644 --- a/macros.package-notes-srpm +++ b/macros.package-notes-srpm @@ -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}}