#!/bin/sh
# Figure out our root directory
ROOTDIR=$(pwd)
unset CHROOT
if test "${ROOTDIR}" != "/"; then
  CHROOT="chroot ${ROOTDIR} "
  ROOTDIR="${ROOTDIR}/"
fi
if [ -x usr/bin/update-desktop-database ]; then
  ${CHROOT} /usr/bin/update-desktop-database /usr/share/applications >/dev/null 2>&1
fi
if [ -x usr/bin/gtk-update-icon-cache ]; then
  ${CHROOT} /usr/bin/gtk-update-icon-cache /hicolor >/dev/null 2>&1
fi
if [ -x usr/bin/update-mime-database ]; then
  ${CHROOT} /usr/bin/update-mime-database /usr/share/mime &> /dev/null
fi


( cd usr/share/opera/locale/en ; rm -rf license.txt )
( cd usr/share/opera/locale/en ; ln -sf ../../../doc/opera/LICENSE license.txt )
( cd usr/share/opera/defaults ; rm -rf license.txt )
( cd usr/share/opera/defaults ; ln -sf ../../doc/opera/LICENSE license.txt )
( cd usr/share/icons/hicolor/22x22/apps ; rm -rf opera-widget.png )
( cd usr/share/icons/hicolor/22x22/apps ; ln -sf ../mimetypes/opera-widget.png opera-widget.png )
( cd usr/share/icons/hicolor/128x128/apps ; rm -rf opera-widget.png )
( cd usr/share/icons/hicolor/128x128/apps ; ln -sf ../mimetypes/opera-widget.png opera-widget.png )
( cd usr/share/icons/hicolor/48x48/apps ; rm -rf opera-widget.png )
( cd usr/share/icons/hicolor/48x48/apps ; ln -sf ../mimetypes/opera-widget.png opera-widget.png )
( cd usr/share/icons/hicolor/scalable/apps ; rm -rf opera-widget.svg )
( cd usr/share/icons/hicolor/scalable/apps ; ln -sf ../mimetypes/opera-widget.svg opera-widget.svg )
( cd usr/share/icons/hicolor/16x16/apps ; rm -rf opera-widget.png )
( cd usr/share/icons/hicolor/16x16/apps ; ln -sf ../mimetypes/opera-widget.png opera-widget.png )
( cd usr/share/icons/hicolor/24x24/apps ; rm -rf opera-widget.png )
( cd usr/share/icons/hicolor/24x24/apps ; ln -sf ../mimetypes/opera-widget.png opera-widget.png )
( cd usr/share/icons/hicolor/32x32/apps ; rm -rf opera-widget.png )
( cd usr/share/icons/hicolor/32x32/apps ; ln -sf ../mimetypes/opera-widget.png opera-widget.png )
