if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/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

chmod +x /etc/profile.d/smlnj.sh
( cd usr/lib/smlnj/bin ; rm -rf ml-burg )
( cd usr/lib/smlnj/bin ; ln -sf .run-sml ml-burg )
( cd usr/lib/smlnj/bin ; rm -rf ml-lex )
( cd usr/lib/smlnj/bin ; ln -sf .run-sml ml-lex )
( cd usr/lib/smlnj/bin ; rm -rf ml-yacc )
( cd usr/lib/smlnj/bin ; ln -sf .run-sml ml-yacc )
( cd usr/lib/smlnj/bin ; rm -rf ml-ulex )
( cd usr/lib/smlnj/bin ; ln -sf .run-sml ml-ulex )
( cd usr/lib/smlnj/bin ; rm -rf ml-nlffigen )
( cd usr/lib/smlnj/bin ; ln -sf .run-sml ml-nlffigen )
( cd usr/lib/smlnj/bin ; rm -rf ml-antlr )
( cd usr/lib/smlnj/bin ; ln -sf .run-sml ml-antlr )
( cd usr/lib/smlnj/bin ; rm -rf sml )
( cd usr/lib/smlnj/bin ; ln -sf .run-sml sml )
