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

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

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

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

# Restart gconfd-2 if running to reload new gconf settings
if ps acx | grep -q gconfd-2 ; then
        killall -HUP gconfd-2 ;
fi

# add mysql user and group
groupadd -g 89 mysql &>/dev/null
useradd -u 89 -g mysql -d /var/lib/mysql -s /bin/false mysql &>/dev/null
usr/bin/mysql_install_db --user=mysql --basedir=/usr
chown -R mysql:mysql var/lib/mysql &>/dev/null
echo " >> "
echo " >> Adding mysql user and group."
echo " >> "

# Add MySQL library directory to /etc/ld.so.conf:
if fgrep "/usr/lib/mysql" etc/ld.so.conf 1> /dev/null 2> /dev/null ; then
	true
else
	echo "/usr/lib/mysql" >> etc/ld.so.conf
fi
if [ -x /sbin/ldconfig ]; then
	/sbin/ldconfig 2> /dev/null
fi

( cd etc/rc.d/init.d ; rm -rf mysqld )
( cd etc/rc.d/init.d ; ln -sf /etc/rc.d/mysqld mysqld )
( cd usr/lib/mysql ; rm -rf libmysqlclient_r.a )
( cd usr/lib/mysql ; ln -sf libmysqlclient.a libmysqlclient_r.a )
( cd usr/lib/mysql ; rm -rf libmysqlclient_r.so.18.0.0 )
( cd usr/lib/mysql ; ln -sf libmysqlclient.so libmysqlclient_r.so.18.0.0 )
( cd usr/lib/mysql ; rm -rf libmysqlclient_r.so.18 )
( cd usr/lib/mysql ; ln -sf libmysqlclient.so libmysqlclient_r.so.18 )
( cd usr/lib/mysql ; rm -rf libmysqlclient.so )
( cd usr/lib/mysql ; ln -sf libmysqlclient.so.18 libmysqlclient.so )
( cd usr/lib/mysql ; rm -rf libmysqlclient.so.18 )
( cd usr/lib/mysql ; ln -sf libmysqlclient.so.18.0.0 libmysqlclient.so.18 )
( cd usr/lib/mysql ; rm -rf libmysqlclient_r.so )
( cd usr/lib/mysql ; ln -sf libmysqlclient.so libmysqlclient_r.so )
