From b7381d643d018ac490a95e8ef802821880c6e8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 21 Jan 2022 16:34:39 +0100 Subject: [PATCH] Use %{buildsubdir} in %_package_note_file if defined Thanks to this the file is (in the common case) created in the unpacked build directory, and not one level up. I.e. /builddir/build/BUILD/lirc-0.10.0/.package_note-lirc-0.10.0-34.fc36.x86_64 instead of /builddir/build/BUILD/.package_note-lirc-0.10.0-34.fc36.x86_64.ld. This is nicer esp. for 'fedpkg local' builds, where the dist-git directory is used as the build dir. When there are multiple %setup calls, the *last* extracted directory becomes %{buildsubdir}. This might be confusing, but it shouldn't cause problems for this use. Suggested in https://bugzilla.redhat.com/show_bug.cgi?id=2043092#c21. --- macros.package-notes-srpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros.package-notes-srpm b/macros.package-notes-srpm index 1f52e51..20d9d6f 100644 --- a/macros.package-notes-srpm +++ b/macros.package-notes-srpm @@ -1,7 +1,7 @@ # Add an ELF note with information about the package the code was compiled for. # See https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects # for details. -%_package_note_file %{_builddir}/.package_note-%{name}-%{version}-%{release}.%{_arch}.ld +%_package_note_file %{_builddir}%{?buildsubdir:/%{buildsubdir}}/.package_note-%{name}-%{version}-%{release}.%{_arch}.ld %_package_note_flags %{?_package_note_file:%{?name:%["%_target_cpu" == "noarch"?"":"-Wl,-dT,%{_package_note_file}"]}}