# update rarian database
if [ -x usr/bin/rarian-sk-update ]; then
  usr/bin/rarian-sk-update 1> /dev/null 2> /dev/null
fi

if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

if [ -x /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi

if [ -e usr/share/glib-2.0/schemas ]; then
  if [ -x /usr/bin/glib-compile-schemas ]; then
    /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas >/dev/null 2>&1
  fi
fi

# If needed -- be sure to sed @LIBDIR@ inside the build script
chroot . /usr/bin/gio-querymodules @LIBDIR@/gio/modules/ 1> /dev/null 2> /dev/null

if [ -x /usr/bin/install-info ]; then
  chroot . /usr/bin/install-info --info-dir=/usr/info /usr/info/blah.gz 2> /dev/null
fi

( cd usr/lib ; rm -rf libQt5GStreamer-1.0.so.0 )
( cd usr/lib ; ln -sf libQt5GStreamer-1.0.so.1.2.0 libQt5GStreamer-1.0.so.0 )
( cd usr/lib ; rm -rf libQt5GStreamerUtils-1.0.so.0 )
( cd usr/lib ; ln -sf libQt5GStreamerUtils-1.0.so.1.2.0 libQt5GStreamerUtils-1.0.so.0 )
( cd usr/lib ; rm -rf libQt5GStreamerQuick-1.0.so )
( cd usr/lib ; ln -sf libQt5GStreamerQuick-1.0.so.0 libQt5GStreamerQuick-1.0.so )
( cd usr/lib ; rm -rf libQt5GLib-2.0.so )
( cd usr/lib ; ln -sf libQt5GLib-2.0.so.0 libQt5GLib-2.0.so )
( cd usr/lib ; rm -rf libQt5GStreamerQuick-1.0.so.0 )
( cd usr/lib ; ln -sf libQt5GStreamerQuick-1.0.so.1.2.0 libQt5GStreamerQuick-1.0.so.0 )
( cd usr/lib ; rm -rf libQt5GStreamer-1.0.so )
( cd usr/lib ; ln -sf libQt5GStreamer-1.0.so.0 libQt5GStreamer-1.0.so )
( cd usr/lib ; rm -rf libQt5GStreamerUi-1.0.so.0 )
( cd usr/lib ; ln -sf libQt5GStreamerUi-1.0.so.1.2.0 libQt5GStreamerUi-1.0.so.0 )
( cd usr/lib ; rm -rf libQt5GStreamerUi-1.0.so )
( cd usr/lib ; ln -sf libQt5GStreamerUi-1.0.so.0 libQt5GStreamerUi-1.0.so )
( cd usr/lib ; rm -rf libQt5GLib-2.0.so.0 )
( cd usr/lib ; ln -sf libQt5GLib-2.0.so.1.2.0 libQt5GLib-2.0.so.0 )
( cd usr/lib ; rm -rf libQt5GStreamerUtils-1.0.so )
( cd usr/lib ; ln -sf libQt5GStreamerUtils-1.0.so.0 libQt5GStreamerUtils-1.0.so )
