diff --git a/0055-let-debuginfo-packages-provide-the-build-id.patch b/0055-let-debuginfo-packages-provide-the-build-id.patch new file mode 100644 index 0000000..7de7aca --- /dev/null +++ b/0055-let-debuginfo-packages-provide-the-build-id.patch @@ -0,0 +1,103 @@ +From 7bac47a54fef8fc01fa29865a9622677dbdfa28d Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Wed, 3 Aug 2016 11:14:05 +0200 +Subject: [PATCH 55/55] let debuginfo packages provide the build-id + +This patch lets debuginfo packages provide build-id like follows: + + debuginfo(build-id) = c63cb23876c5fa85f36beaff58f8557e1bf22517 + +Originally this patch was written by Jan Blunck . + +Signed-off-by: Igor Gnatenko +(cherry picked from commit 95712183458748ea6cafebac1bdd5daa097d9bee) +--- + fileattrs/Makefile.am | 4 ++-- + fileattrs/debuginfo.attr | 2 ++ + macros.in | 3 ++- + scripts/Makefile.am | 2 ++ + scripts/debuginfo.prov | 14 ++++++++++++++ + 5 files changed, 22 insertions(+), 3 deletions(-) + create mode 100644 fileattrs/debuginfo.attr + create mode 100755 scripts/debuginfo.prov + +diff --git a/fileattrs/Makefile.am b/fileattrs/Makefile.am +index e54395b3b..148d2ff0d 100644 +--- a/fileattrs/Makefile.am ++++ b/fileattrs/Makefile.am +@@ -5,8 +5,8 @@ include $(top_srcdir)/rpm.am + fattrsdir = $(rpmconfigdir)/fileattrs + + fattrs_DATA = \ +- appdata.attr desktop.attr elf.attr font.attr libtool.attr perl.attr \ +- perllib.attr pkgconfig.attr python.attr ocaml.attr script.attr \ ++ appdata.attr debuginfo.attr desktop.attr elf.attr font.attr libtool.attr \ ++ perl.attr perllib.attr pkgconfig.attr python.attr ocaml.attr script.attr \ + mono.attr + + EXTRA_DIST = $(fattrs_DATA) +diff --git a/fileattrs/debuginfo.attr b/fileattrs/debuginfo.attr +new file mode 100644 +index 000000000..03f453843 +--- /dev/null ++++ b/fileattrs/debuginfo.attr +@@ -0,0 +1,2 @@ ++%__debuginfo_provides %{_rpmconfigdir}/debuginfo.prov ++%__debuginfo_path ^/usr/lib/debug/ +diff --git a/macros.in b/macros.in +index 2a114ccd7..962b84ade 100644 +--- a/macros.in ++++ b/macros.in +@@ -200,7 +200,8 @@ + %package debuginfo\ + Summary: Debug information for package %{name}\ + Group: Development/Debug\ +-AutoReqProv: 0\ ++AutoReq: 0\ ++AutoProv: 1\ + %description debuginfo\ + This package provides debug information for package %{name}.\ + Debug information is useful when developing applications that use this\ +diff --git a/scripts/Makefile.am b/scripts/Makefile.am +index 036105d63..8e60c3ce7 100644 +--- a/scripts/Makefile.am ++++ b/scripts/Makefile.am +@@ -10,6 +10,7 @@ EXTRA_DIST = \ + brp-strip-shared brp-strip-static-archive \ + check-files check-prereqs \ + check-buildroot check-rpaths check-rpaths-worker \ ++ debuginfo.prov \ + find-debuginfo.sh find-lang.sh \ + perl.prov perl.req pythondeps.sh \ + rpmdb_loadcvt rpm.daily rpm.log rpm.supp rpm2cpio.sh \ +@@ -29,6 +30,7 @@ rpmconfig_SCRIPTS = \ + brp-strip-shared brp-strip-static-archive \ + check-files check-prereqs \ + check-buildroot check-rpaths check-rpaths-worker \ ++ debuginfo.prov \ + find-lang.sh find-requires find-provides \ + perl.prov perl.req pythondeps.sh \ + mono-find-requires mono-find-provides \ +diff --git a/scripts/debuginfo.prov b/scripts/debuginfo.prov +new file mode 100755 +index 000000000..a8636c976 +--- /dev/null ++++ b/scripts/debuginfo.prov +@@ -0,0 +1,14 @@ ++#!/bin/sh ++ ++while read instfile; do ++ case "$instfile" in ++ */usr/lib/debug/.build-id/*.debug) ++ if [ -f "$instfile" ]; then ++ BUILDID=$(echo "$instfile" | sed -ne 's|.*/usr/lib/debug/.build-id/\([0-9a-f]\+\)/\([0-9a-f]\+\)\.debug|\1\2|p') ++ if [ -n "$BUILDID" ]; then ++ echo "debuginfo(build-id) = $BUILDID" ++ fi ++ fi ++ ;; ++ esac ++done +-- +2.13.2 + diff --git a/rpm.spec b/rpm.spec index 0a66e61..a59c630 100644 --- a/rpm.spec +++ b/rpm.spec @@ -33,7 +33,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: %{?snapver:0.%{snapver}.}30%{?dist} +Release: %{?snapver:0.%{snapver}.}31%{?dist} Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://ftp.rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2 @@ -142,6 +142,9 @@ Patch323: 0053-Change-mkattr-to-always-create-a-defattr-with-explic.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1468476 Patch330: 0054-rpmfc-fix-ternary-operator.patch +# debuginfo packages should automatically provide debuginfo(build-id) = ... +Patch331: 0055-let-debuginfo-packages-provide-the-build-id.patch + # These are not yet upstream Patch902: rpm-4.7.1-geode-i686.patch # Probably to be upstreamed in slightly different form @@ -640,6 +643,9 @@ exit 0 %doc doc/librpm/html/* %changelog +* Wed Jul 12 2017 Igor Gnatenko - 4.13.0.1-31 +- Add automatic provides debuginfo(build-id) = ... into debuginfo subpackages + * Fri Jul 07 2017 Igor Gnatenko - 4.13.0.1-30 - Fix brokeness when using %%filter_setup (RHBZ #1468476)