# Clean up a potential upgrade mess caused by changing the
# installation directory to /usr/lib/java/:
if [ -L usr/lib/java ]; then
  rm -rf usr/lib/java
  mkdir -p usr/lib/java/man
  mkdir -p usr/lib/java/lib/i386/server
  mkdir -p usr/lib/java/lib/i386/client
  mkdir -p usr/lib/java/javaws
  mkdir -p usr/lib/java/bin
  mkdir -p usr/lib/mozilla/plugins
fi
if [ -L ControlPanel ]; then
  rm -f ControlPanel
fi
if [ -L ja ]; then
  rm -f ja
fi
if [ -L javaws ]; then
  rm -f javaws
fi
if [ -L libjsig.so ]; then
  rm -f libjsig.so
fi
# End cleanup.
( cd usr/lib/java/javaws ; rm -rf javaws )
( cd usr/lib/java/javaws ; ln -sf ../bin/javaws javaws )
( cd usr/lib/java/lib/i386/server ; rm -rf libjsig.so )
( cd usr/lib/java/lib/i386/server ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib/java/lib/i386/client ; rm -rf libjsig.so )
( cd usr/lib/java/lib/i386/client ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib/java/man ; rm -rf ja )
( cd usr/lib/java/man ; ln -sf ja_JP.eucJP ja )
( cd usr/lib/java/bin ; rm -rf ControlPanel )
( cd usr/lib/java/bin ; ln -sf ./jcontrol ControlPanel )
( cd usr/lib/mozilla/plugins ; rm -rf libjavaplugin_oji.so )
( cd usr/lib/mozilla/plugins ; ln -sf /usr/lib/java/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so )
( cd usr/lib ; rm -rf jre1.6.0_06 )
( cd usr/lib ; ln -sf java jre1.6.0_06 )
