#!/bin/sh
while [ "$1" != "-stack" ]; do
        shift
done

filename=`mktemp -t ooocrash.XXXXXXXXXX` || exit 1
echo "Video Driver is probably:" `grep -A10 'Section[ \t]*"Device"' /etc/X11/xorg.conf | grep Driver | sed -s 's@.*\"\(.*\)\".*@\1@'` > $filename
echo "Desktop is: `if [ "$GNOME_DESKTOP_SESSION_ID" != "" ] ; then echo GNOME ; else echo not GNOME; fi`" >> $filename
echo "libgcj version is:" `rpm -q libgcj` >> $filename
echo "kernel is:" `uname -s -r -v -m -p -i` >> $filename
echo "OpenOffice.org core rpm version is:" `rpm -q openoffice.org-core` >> $filename
echo "accessibility is:" `gconftool-2 -g "/desktop/gnome/interface/accessibility"` >> $filename
if [ -e /usr/sbin/sestatus ]; then
echo "...start sestatus details ..." >> $filename
/usr/sbin/sestatus >> $filename
echo "...end sestatus details ..." >> $filename
fi

if [ -e /usr/bin/c++filt ]; then
        cat $2 | c++filt >> $filename
else
        cat $2 >> $filename
fi

rm $2

echo
echo ---start copy and paste here---
cat $filename
echo ---end copy and paste here---
echo paste the above into your bug report

if [ -e /usr/bin/zenity ]; then
        zenity --width=800 --height=600 --title="OOo has crashed!: Paste this text into your bugreport" --text-info --filename=$filename
fi

rm -f $filename
