# Update the desktop and mime database:
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/update-mime-database ]; then
  chroot . /usr/bin/update-mime-database usr/share/mime > /dev/null 2>&1
fi
if [ -x usr/bin/gtk-update-icon-cache ] ; then
  chroot . /usr/bin/gtk-update-icon-cache --quiet usr/share/icons/hicolor 
fi

( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationSerif-Italic.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationSerif-Italic.ttf LiberationSerif-Italic.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationSans-Regular.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationSans-Regular.ttf LiberationSans-Regular.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationSans-BoldItalic.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationSans-BoldItalic.ttf LiberationSans-BoldItalic.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationSans-Bold.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationSans-Bold.ttf LiberationSans-Bold.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationSerif-Regular.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationSerif-Regular.ttf LiberationSerif-Regular.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationMono-BoldItalic.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationMono-BoldItalic.ttf LiberationMono-BoldItalic.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationSerif-Bold.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationSerif-Bold.ttf LiberationSerif-Bold.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationSans-Italic.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationSans-Italic.ttf LiberationSans-Italic.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationMono-Bold.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationMono-Bold.ttf LiberationMono-Bold.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationSerif-BoldItalic.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationSerif-BoldItalic.ttf LiberationSerif-BoldItalic.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationMono-Italic.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationMono-Italic.ttf LiberationMono-Italic.ttf )
( cd usr/share/calibre/fonts/liberation ; rm -rf LiberationMono-Regular.ttf )
( cd usr/share/calibre/fonts/liberation ; ln -sf /usr/share/fonts/TTF/LiberationMono-Regular.ttf LiberationMono-Regular.ttf )
( cd usr/share/icons/hicolor/128x128/mimetypes ; rm -rf gnome-mime-application-x-kindle-application.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; ln -sf application-x-kindle-application.png gnome-mime-application-x-kindle-application.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; rm -rf gnome-mime-application-lrf.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; ln -sf application-lrf.png gnome-mime-application-lrf.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; rm -rf gnome-mime-application-x-topaz-ebook.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; ln -sf application-x-topaz-ebook.png gnome-mime-application-x-topaz-ebook.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; rm -rf gnome-mime-text-lrs.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; ln -sf text-lrs.png gnome-mime-text-lrs.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; rm -rf gnome-mime-application-x-mobi8-ebook.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; ln -sf application-x-mobi8-ebook.png gnome-mime-application-x-mobi8-ebook.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; rm -rf gnome-mime-application-x-mobipocket-ebook.png )
( cd usr/share/icons/hicolor/128x128/mimetypes ; ln -sf application-x-mobipocket-ebook.png gnome-mime-application-x-mobipocket-ebook.png )
( cd usr/lib/calibre ; rm -rf python )
( cd usr/lib/calibre ; ln -sf python2 python )
( cd usr/lib/calibre ; rm -rf python2 )
( cd usr/lib/calibre ; ln -sf python2.7 python2 )
( cd usr/lib/calibre ; rm -rf python2-config )
( cd usr/lib/calibre ; ln -sf python2.7-config python2-config )
( cd usr/lib/calibre ; rm -rf python-config )
( cd usr/lib/calibre ; ln -sf python2-config python-config )
( cd usr/lib/calibre/lib ; rm -rf libpython2.7.so )
( cd usr/lib/calibre/lib ; ln -sf libpython2.7.so.1.0 libpython2.7.so )
