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 -f usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi
( cd opt/eagle-7.7.0 ; rm -rf doc )
( cd opt/eagle-7.7.0 ; ln -sf /usr/doc/eagle-7.7.0 doc )
( cd usr/bin ; rm -rf eagle )
( cd usr/bin ; ln -sf /opt/eagle-7.7.0/bin/eagle eagle )
( cd usr/share/icons/hicolor/16x16/apps ; rm -rf eagle.png )
( cd usr/share/icons/hicolor/16x16/apps ; ln -sf /opt/eagle-7.7.0/bin/eagleicon16.png eagle.png )
( cd usr/share/icons/hicolor/48x48/apps ; rm -rf eagle.png )
( cd usr/share/icons/hicolor/48x48/apps ; ln -sf /opt/eagle-7.7.0/bin/eagleicon50.png eagle.png )
