From 1de7d81cf05827bfc39d31de238cddc962ffff74 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Thu, 21 Nov 2002 16:54:33 +0000 Subject: [PATCH] Pass __strip and __objdump macros --- brp-strip | 5 +++-- brp-strip-comment-note | 9 +++++++-- brp-strip-shared | 4 +++- macros | 4 ++-- redhat-rpm-config.spec | 5 ++++- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/brp-strip b/brp-strip index 6f0388c..3a4f923 100755 --- a/brp-strip +++ b/brp-strip @@ -3,11 +3,12 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then exit 0 fi - +[ -z "$STRIP" -a -n "$1" ] && STRIP="$1" +[ -z "$STRIP" ] && STRIP=strip # 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 || : + $STRIP -g $f || : done diff --git a/brp-strip-comment-note b/brp-strip-comment-note index 15a5ed2..db32226 100755 --- a/brp-strip-comment-note +++ b/brp-strip-comment-note @@ -4,15 +4,20 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then exit 0 fi +[ -z "$STRIP" -a -n "$1" ] && STRIP="$1" +[ -z "$OBJDUMP" -a -n "$2" ] && OBJDUMP="$2" +[ -z "$STRIP" ] && STRIP=strip +[ -z "$OBJDUMP" ] && OBJDUMP=objdump + # 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 | \ + if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \ grep ALLOC >/dev/null; then note= fi - strip -R .comment $note $f || : + $STRIP -R .comment $note $f || : done diff --git a/brp-strip-shared b/brp-strip-shared index d254f53..1e8300e 100755 --- a/brp-strip-shared +++ b/brp-strip-shared @@ -7,6 +7,8 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then exit 0 fi +[ -z "$STRIP" -a -n "$1" ] && STRIP="$1" +[ -z "$STRIP" ] && STRIP=strip # Strip ELF shared objects # Please note we don't restrict our search to executable files because # our libraries are not (should not be, at least) +x. @@ -14,5 +16,5 @@ 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 + $STRIP --strip-unneeded $f done diff --git a/macros b/macros index fb60e6c..942f1b2 100644 --- a/macros +++ b/macros @@ -82,8 +82,8 @@ %__os_install_post \ /usr/lib/rpm/redhat/brp-compress \ - /usr/lib/rpm/redhat/brp-strip \ - /usr/lib/rpm/redhat/brp-strip-comment-note \ + /usr/lib/rpm/redhat/brp-strip %{__strip} \ + /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ %{nil} %__spec_install_post\ diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 9f00fab..1115940 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -1,6 +1,6 @@ Summary: Red Hat specific rpm configuration files. Name: redhat-rpm-config -Version: 8.0.5 +Version: 8.0.6 Release: 1 License: GPL Group: Development/System @@ -27,6 +27,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_prefix}/lib/rpm/redhat %changelog +* Thu Nov 21 2002 Elliot Lee 8.0.6-1 +- Pass __strip and __objdump macros + * Thu Nov 21 2002 Elliot Lee 8.0.5-1 - Update macros to specify find-provides/find-requires