mingw-filesystem/mingw32-find-debuginfo.sh
epienbro d9bad00f48 - Add script to create -debuginfo subpackages This script was created by
Fridrich Strba
- All mingw32 packages now need to add these lines to their .spec files:
    %define __os_install_post %{_mingw32_debug_install_post}
    %{_mingw32_debug_package}
2009-06-22 10:18:35 +00:00

32 lines
942 B
Bash
Executable File

#!/bin/sh
#mingw32_find-debuginfo.sh - automagically generate debug info and file list
#for inclusion in an rpm spec file for mingw32-* packages.
if [ -z "$1" ] ; then BUILDDIR="."
else BUILDDIR=$1
fi
for f in `find $RPM_BUILD_ROOT -type f -name "*.exe" -or -name "*.dll"`
do
case $(i686-pc-mingw32-objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
*debuglink*) continue ;;
*debug*) ;;
*gnu.version*)
echo "WARNING: "`echo $f | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!"
continue
;;
*) continue ;;
esac
echo extracting debug info from $f
i686-pc-mingw32-objcopy --only-keep-debug $f $f.debug || :
pushd `dirname $f`
i686-pc-mingw32-objcopy --add-gnu-debuglink=`basename $f.debug` --strip-unneeded `basename $f` || :
popd
done
find $RPM_BUILD_ROOT -type f -name "*.exe.debug" -or -name "*.dll.debug" |
sed -n -e "s#^$RPM_BUILD_ROOT##p" > $BUILDDIR/debugfiles.list