diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-01-27 09:40:15 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-01-27 09:40:15 +0200 |
commit | 79859ff04fc31a04fb8dfd61020bc5bca4408198 (patch) | |
tree | 8abcfddc7375ae0da602ccaebb52d18b4b1b7a05 | |
parent | 010b342d6229ae633c84282dbb6b9e5a9d2127b0 (diff) | |
download | rpm-79859ff04fc31a04fb8dfd61020bc5bca4408198.tar.gz |
Pass %{__strip} and %{__objdump} to brp-strip* scripts
- permits easy overriding of the used tools globally
-rw-r--r-- | platform.in | 6 | ||||
-rwxr-xr-x | scripts/brp-strip | 4 | ||||
-rwxr-xr-x | scripts/brp-strip-comment-note | 7 | ||||
-rw-r--r-- | scripts/brp-strip-shared | 4 | ||||
-rwxr-xr-x | scripts/brp-strip-static-archive | 4 |
5 files changed, 17 insertions, 8 deletions
diff --git a/platform.in b/platform.in index 2c2539893..a04d8fc38 100644 --- a/platform.in +++ b/platform.in @@ -54,9 +54,9 @@ %__os_install_post \ %{_rpmconfigdir}/brp-compress \ - %{_rpmconfigdir}/brp-strip \ - %{_rpmconfigdir}/brp-strip-static-archive \ - %{_rpmconfigdir}/brp-strip-comment-note \ + %{_rpmconfigdir}/brp-strip %{__strip} \ + %{_rpmconfigdir}/brp-strip-static-archive %{__strip} \ + %{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \ %{nil} %__spec_install_post\ diff --git a/scripts/brp-strip b/scripts/brp-strip index 66bb197bd..8acc22fab 100755 --- a/scripts/brp-strip +++ b/scripts/brp-strip @@ -4,6 +4,8 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then exit 0 fi +STRIP=${1:-strip} + case `uname -a` in Darwin*) exit 0 ;; *) ;; @@ -14,5 +16,5 @@ for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm 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/scripts/brp-strip-comment-note b/scripts/brp-strip-comment-note index ac428a839..90cd2ae6c 100755 --- a/scripts/brp-strip-comment-note +++ b/scripts/brp-strip-comment-note @@ -4,6 +4,9 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then exit 0 fi +STRIP=${1:-strip} +OBJDUMP=${2:-objdump} + case `uname -a` in Darwin*) exit 0 ;; *) ;; @@ -15,9 +18,9 @@ for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm 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/scripts/brp-strip-shared b/scripts/brp-strip-shared index fc614067c..da46431b3 100644 --- a/scripts/brp-strip-shared +++ b/scripts/brp-strip-shared @@ -7,6 +7,8 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then exit 0 fi +STRIP=${1:-strip} + case `uname -a` in Darwin*) exit 0 ;; *) ;; @@ -19,5 +21,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/scripts/brp-strip-static-archive b/scripts/brp-strip-static-archive index 961ae272c..d7bff332e 100755 --- a/scripts/brp-strip-static-archive +++ b/scripts/brp-strip-static-archive @@ -4,6 +4,8 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then exit 0 fi +STRIP=${1:-strip} + case `uname -a` in Darwin*) exit 0 ;; *) ;; @@ -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 'current ar archive' | \ sed -n -e 's/^\(.*\):[ ]*current ar archive/\1/p'`; do - strip -g "$f" + $STRIP -g "$f" done |