summaryrefslogtreecommitdiff
path: root/scripts/brp-strip-shared
diff options
context:
space:
mode:
authorKim Kibum <kb0929.kim@samsung.com>2012-05-21 17:49:08 +0900
committerKim Kibum <kb0929.kim@samsung.com>2012-05-21 17:49:08 +0900
commitdec48cfa66e17ba4a7e50c92cb24b913289feb12 (patch)
treee1f48cd5cabb40a1d604b36949ff072d01267cb5 /scripts/brp-strip-shared
parentb7a3bffb8e0341b7e4ef69def268bca3a7f279ff (diff)
downloadrpm-dec48cfa66e17ba4a7e50c92cb24b913289feb12.tar.gz
rpm-dec48cfa66e17ba4a7e50c92cb24b913289feb12.tar.bz2
rpm-dec48cfa66e17ba4a7e50c92cb24b913289feb12.zip
Upload Tizen:Base source
Diffstat (limited to 'scripts/brp-strip-shared')
-rw-r--r--scripts/brp-strip-shared25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/brp-strip-shared b/scripts/brp-strip-shared
new file mode 100644
index 0000000..da46431
--- /dev/null
+++ b/scripts/brp-strip-shared
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Conectiva brp - strip shared libraries. Based on Red Hat's brp-strip.
+# Thu Apr 20 - Guilherme Manika <gwm@conectiva.com.br>
+# Created file
+
+if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
+ exit 0
+fi
+
+STRIP=${1:-strip}
+
+case `uname -a` in
+Darwin*) exit 0 ;;
+*) ;;
+esac
+
+# 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.
+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"
+done