summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-08-22 19:21:14 +0000
committerjbj <devnull@localhost>2002-08-22 19:21:14 +0000
commit90b34cd4e51de9b69a1a1e4bf58fcee31c2bf192 (patch)
tree7a93209a036d240f45566769c65f557d55588460 /scripts
parent9db12e8040c6bc6700a9a1c88e7724c11c43f892 (diff)
downloadlibrpm-tizen-90b34cd4e51de9b69a1a1e4bf58fcee31c2bf192.tar.gz
librpm-tizen-90b34cd4e51de9b69a1a1e4bf58fcee31c2bf192.tar.bz2
librpm-tizen-90b34cd4e51de9b69a1a1e4bf58fcee31c2bf192.zip
- add a macro to create a sub-package with debugging symbols.
CVS patchset: 5662 CVS date: 2002/08/22 19:21:14
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am4
-rw-r--r--scripts/find-debuginfo.sh17
2 files changed, 19 insertions, 2 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 12451b09f..65c34c980 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -6,7 +6,7 @@ EXTRA_DIST = \
brp-compress brp-redhat brp-strip brp-strip-comment-note \
brp-strip-shared brp-sparc64-linux \
check-files check-prereqs convertrpmrc.sh cross-build \
- find-lang.sh find-prov.pl find-req.pl \
+ find-debuginfo.sh find-lang.sh find-prov.pl find-req.pl \
cpanflute cpanflute2 Specfile.pm find-provides.perl \
find-requires.perl get_magic.pl getpo.sh http.req \
magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi \
@@ -25,7 +25,7 @@ config_SCRIPTS = \
brp-compress brp-redhat brp-strip brp-strip-comment-note \
brp-strip-shared brp-sparc64-linux \
check-files check-prereqs convertrpmrc.sh cross-build \
- find-lang.sh find-prov.pl find-req.pl \
+ find-debuginfo.sh find-lang.sh find-prov.pl find-req.pl \
cpanflute cpanflute2 Specfile.pm find-provides.perl \
find-requires.perl get_magic.pl getpo.sh http.req \
magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi \
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
new file mode 100644
index 000000000..33776899d
--- /dev/null
+++ b/scripts/find-debuginfo.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+#find-debuginfo.sh - automagically generate debug info and file list
+#for inclusion in an rpm spec file.
+
+LISTFILE=debugfiles.list
+
+# Strip ELF binaries
+for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
+ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
+ BASEDIR=`dirname $f | sed -n -e "s#^$RPM_BUILD_ROOT#/#p"`
+ OUTPUTDIR=${RPM_BUILD_ROOT}/usr/lib/debug${BASEDIR}
+ mkdir -p ${OUTPUTDIR}
+ echo extracting debug info from $f
+ striptofile -g -u -o $OUTPUTDIR $f || :
+done
+
+find ${RPM_BUILD_ROOT}/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT#/#p" > $LISTFILE