Make brp-strip* not strip debug objects

Add a _enable_debug_packages macro (commented out)
This commit is contained in:
Alexander Larsson 2002-11-20 16:55:36 +00:00
parent f3e01161c3
commit 27ac1446b0
4 changed files with 8 additions and 1 deletions

View File

@ -6,6 +6,7 @@ fi
# Strip ELF binaries # Strip ELF binaries
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \ 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,' | \ grep -v ' shared object,' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
strip -g $f || : strip -g $f || :

View File

@ -7,6 +7,7 @@ fi
# Strip .comment and .note sections (the latter only if it is not allocated) # Strip .comment and .note sections (the latter only if it is not allocated)
# for already stripped elf files in the build root # 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 {} \; | \ 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 sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do
note="-R .note" note="-R .note"
if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \ if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \

View File

@ -11,6 +11,7 @@ fi
# Please note we don't restrict our search to executable files because # Please note we don't restrict our search to executable files because
# our libraries are not (should not be, at least) +x. # our libraries are not (should not be, at least) +x.
for f in `find $RPM_BUILD_ROOT -type f -a -exec file {} \; | \ for f in `find $RPM_BUILD_ROOT -type f -a -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
grep ' shared object,' | \ grep ' shared object,' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
strip --strip-unneeded $f strip --strip-unneeded $f

6
macros
View File

@ -21,6 +21,8 @@
%_defaultdocdir %{_usr}/share/doc %_defaultdocdir %{_usr}/share/doc
#%_enable_debug_packages 1
#============================================================================== #==============================================================================
# ---- configure and makeinstall. # ---- configure and makeinstall.
# #
@ -92,7 +94,9 @@
# Bad hack to set $LANG to C during all RPM builds # Bad hack to set $LANG to C during all RPM builds
%prep %%prep\ %prep \
%{?_enable_debug_packages:%{debug_package}}\
%%prep\
LANG=C\ LANG=C\
export LANG\ export LANG\
%{nil} %{nil}