Pass %{__strip} and %{__objdump} to brp-strip* scripts
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 27 Jan 2010 07:40:15 +0000 (09:40 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 27 Jan 2010 07:40:15 +0000 (09:40 +0200)
- permits easy overriding of the used tools globally

platform.in
scripts/brp-strip
scripts/brp-strip-comment-note
scripts/brp-strip-shared
scripts/brp-strip-static-archive

index 2c25398..a04d8fc 100644 (file)
@@ -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\
index 66bb197..8acc22f 100755 (executable)
@@ -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
index ac428a8..90cd2ae 100755 (executable)
@@ -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
index fc61406..da46431 100644 (file)
@@ -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
index 961ae27..d7bff33 100755 (executable)
@@ -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