From 27ac1446b099a61a4ae1a28069a8aef9163a61ce Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 20 Nov 2002 16:55:36 +0000 Subject: [PATCH] Make brp-strip* not strip debug objects Add a _enable_debug_packages macro (commented out) --- brp-strip | 1 + brp-strip-comment-note | 1 + brp-strip-shared | 1 + macros | 6 +++++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/brp-strip b/brp-strip index f959134..6f0388c 100755 --- a/brp-strip +++ b/brp-strip @@ -6,6 +6,7 @@ fi # Strip ELF binaries for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ grep -v ' shared object,' | \ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do strip -g $f || : diff --git a/brp-strip-comment-note b/brp-strip-comment-note index 1c853cf..15a5ed2 100755 --- a/brp-strip-comment-note +++ b/brp-strip-comment-note @@ -7,6 +7,7 @@ fi # Strip .comment and .note sections (the latter only if it is not allocated) # for already stripped elf files in the build root for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do note="-R .note" if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \ diff --git a/brp-strip-shared b/brp-strip-shared index 501a278..d254f53 100755 --- a/brp-strip-shared +++ b/brp-strip-shared @@ -11,6 +11,7 @@ fi # Please note we don't restrict our search to executable files because # our libraries are not (should not be, at least) +x. for f in `find $RPM_BUILD_ROOT -type f -a -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ grep ' shared object,' | \ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do strip --strip-unneeded $f diff --git a/macros b/macros index 65759e3..7aa23e2 100644 --- a/macros +++ b/macros @@ -21,6 +21,8 @@ %_defaultdocdir %{_usr}/share/doc +#%_enable_debug_packages 1 + #============================================================================== # ---- configure and makeinstall. # @@ -92,7 +94,9 @@ # Bad hack to set $LANG to C during all RPM builds -%prep %%prep\ +%prep \ +%{?_enable_debug_packages:%{debug_package}}\ +%%prep\ LANG=C\ export LANG\ %{nil}