- add brp-strip-shared script <rodrigob@conectiva.com.br>.
authorjbj <devnull@localhost>
Sat, 28 Oct 2000 17:30:58 +0000 (17:30 +0000)
committerjbj <devnull@localhost>
Sat, 28 Oct 2000 17:30:58 +0000 (17:30 +0000)
CVS patchset: 4231
CVS date: 2000/10/28 17:30:58

CHANGES
scripts/Makefile.am
scripts/brp-strip-shared [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index 889b8ba..032e5e5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -20,6 +20,7 @@
        - add cscope/ctags (Rodrigo Barbosa<rodrigob@conectiva.com.br>).
        - remove getMacroBody() from rpmio API.
        - hide libio lossage in prototype, not API.
+       - add brp-strip-shared script <rodrigob@conectiva.com.br>.
 
 3.0.6 -> 4.0
        - use DIRNAMES/BASENAMES/DIRINDICES not FILENAMES in packages and db.
index 8cdc6c9..5e8f649 100644 (file)
@@ -4,6 +4,7 @@ AUTOMAKE_OPTIONS = 1.4 foreign
 
 EXTRA_DIST = \
        brp-compress brp-redhat brp-strip brp-strip-comment-note \
+       brp-strip-shared \
        brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh \
        find-prov.pl find-req.pl cpanflute find-provides.perl \
        find-requires.perl get_magic.pl getpo.sh http.req \
@@ -17,6 +18,7 @@ all:
 configdir = ${prefix}/lib/rpm
 config_SCRIPTS = \
        brp-compress brp-redhat brp-strip brp-strip-comment-note \
+       brp-strip-shared \
        brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh \
        find-prov.pl find-req.pl cpanflute find-provides.perl \
        find-requires.perl get_magic.pl getpo.sh http.req \
diff --git a/scripts/brp-strip-shared b/scripts/brp-strip-shared
new file mode 100644 (file)
index 0000000..501a278
--- /dev/null
@@ -0,0 +1,17 @@
+#!/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 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 ' shared object,' | \
+       sed -n -e 's/^\(.*\):[  ]*ELF.*, not stripped/\1/p'`; do
+       strip --strip-unneeded $f
+done