2 #find-debuginfo.sh - automagically generate debug info and file list
3 #for inclusion in an rpm spec file.
5 LISTFILE=debugfiles.list
8 for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
9 sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
10 BASEDIR=`dirname $f | sed -n -e "s#^$RPM_BUILD_ROOT#/#p"`
11 OUTPUTDIR=${RPM_BUILD_ROOT}/usr/lib/debug${BASEDIR}
13 echo extracting debug info from $f
14 striptofile -g -u -o $OUTPUTDIR $f || :
17 find ${RPM_BUILD_ROOT}/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT#/#p" > $LISTFILE