Search
SailfishOS Open Build Service
>
Projects
>
home:lbt
:
sdk
>
rpm
> _service:gitpkg:0013-Add-debugsource-package-to-rpm-straight-don-t-strip.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:gitpkg:0013-Add-debugsource-package-to-rpm-straight-don-t-strip.patch of Package rpm
From 18904bb455d05cd11651d23a30fdc36ef3d28abe Mon Sep 17 00:00:00 2001 From: David Greaves <david@dgreaves.com> Date: Wed, 17 Apr 2013 20:41:09 +0000 Subject: [PATCH] Add-debugsource-package-to-rpm-straight-don-t-strip- --- macros.in | 12 ++++++++++++ scripts/find-debuginfo.sh | 12 +++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/macros.in b/macros.in index 5aaa503..9497ee4 100644 --- a/macros.in +++ b/macros.in @@ -192,6 +192,18 @@ Debug information is useful when developing applications that use this\ package or when debugging this package.\ %files debuginfo -f debugfiles.list\ %defattr(-,root,root)\ +\ +%package debugsource\ +Summary: Debug sources for package %{name}\ +Group: Development/Debug\ +AutoReqProv: 0\ +Requires: %{name}-debuginfo = %{version}-%{release}\ +%description debugsource\ +This package provides debug sources for package %{name}.\ +Debug sources are useful when developing applications that use this\ +package or when debugging this package.\ +%files debugsource -f debugsources.list\ +%defattr(-,root,root)\ %{nil} %_defaultdocdir %{_datadir}/doc diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh index 902234a..0625d3c 100644 --- a/scripts/find-debuginfo.sh +++ b/scripts/find-debuginfo.sh @@ -196,8 +196,8 @@ set -o pipefail strict_error=ERROR $strict || strict_error=WARNING -# Strip ELF binaries -find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z | +# Strip ELF binaries (and no static libraries) +find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | sort -z | xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' | while read nlinks inum f; do case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in @@ -309,10 +309,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -d "${RPM_BUILD_ROOT}/usr/src" ]; then (cd "${RPM_BUILD_ROOT}/usr" test ! -d lib/debug || find lib/debug ! -type d - test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1 ) | sed 's,^,/usr/,' >> "$LISTFILE" fi +: > "$SOURCEFILE" +if [ -d "${RPM_BUILD_ROOT}/usr/src" ]; then + (cd "${RPM_BUILD_ROOT}/usr" + test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1 + ) | sed 's,^,/usr/,' >> "$SOURCEFILE" +fi + # Append to $1 only the lines from stdin not already in the file. append_uniq() { -- 1.8.2