#!/bin/sh

# Add /usr/share/lyx/fonts to /etc/fonts/local.conf
# if it is not already there.
if [ -f /etc/fonts/local.conf ]; then
    grep -q /usr/share/lyx/fonts /etc/fonts/local.conf
    if [ $? -ne 0 ]; then
	sed 's/^<\/fontconfig>/<dir>\/usr\/share\/lyx\/fonts<\/dir>
<\/fontconfig>/' /etc/fonts/local.conf > /etc/fonts/local.conf.tmp
	mv -f /etc/fonts/local.conf.tmp /etc/fonts/local.conf
	fc-cache /usr/share/lyx/fonts
    fi
fi
    
if [ -x /usr/bin/gtk-update-icon-cache.exe ]
then
    /usr/bin/gtk-update-icon-cache --force /usr/share/icons/hicolor
fi

/usr/bin/update-desktop-database /usr/share/applications
/usr/bin/update-mime-database -n /usr/share/mime

