if [ -x /usr/bin/update-mime-database ]; then
   /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi
if [ -x /usr/bin/update-desktop-database ]; then
   /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
( cd usr/bin ; rm -rf libreoffice5.1 )
( cd usr/bin ; ln -sf /opt/libreoffice5.1/program/soffice libreoffice5.1 )
( cd usr/share/applications ; rm -rf libreoffice5.1-math.desktop )
( cd usr/share/applications ; ln -sf /opt/libreoffice5.1/share/xdg/math.desktop libreoffice5.1-math.desktop )
( cd usr/share/applications ; rm -rf libreoffice5.1-base.desktop )
( cd usr/share/applications ; ln -sf /opt/libreoffice5.1/share/xdg/base.desktop libreoffice5.1-base.desktop )
( cd usr/share/applications ; rm -rf libreoffice5.1-xsltfilter.desktop )
( cd usr/share/applications ; ln -sf /opt/libreoffice5.1/share/xdg/xsltfilter.desktop libreoffice5.1-xsltfilter.desktop )
( cd usr/share/applications ; rm -rf libreoffice5.1-draw.desktop )
( cd usr/share/applications ; ln -sf /opt/libreoffice5.1/share/xdg/draw.desktop libreoffice5.1-draw.desktop )
( cd usr/share/applications ; rm -rf libreoffice5.1-writer.desktop )
( cd usr/share/applications ; ln -sf /opt/libreoffice5.1/share/xdg/writer.desktop libreoffice5.1-writer.desktop )
( cd usr/share/applications ; rm -rf libreoffice5.1-startcenter.desktop )
( cd usr/share/applications ; ln -sf /opt/libreoffice5.1/share/xdg/startcenter.desktop libreoffice5.1-startcenter.desktop )
( cd usr/share/applications ; rm -rf libreoffice5.1-calc.desktop )
( cd usr/share/applications ; ln -sf /opt/libreoffice5.1/share/xdg/calc.desktop libreoffice5.1-calc.desktop )
( cd usr/share/applications ; rm -rf libreoffice5.1-impress.desktop )
( cd usr/share/applications ; ln -sf /opt/libreoffice5.1/share/xdg/impress.desktop libreoffice5.1-impress.desktop )
