
# 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/jre/lib/i386/server
  mkdir -p usr/lib/java/jre/lib/i386/client
  mkdir -p usr/lib/java/jre/javaws
  mkdir -p usr/lib/java/jre/bin
  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 ; rm -rf libjvm.so )
( cd usr/lib ; ln -sf ./java/jre/lib/i386/server/libjvm.so libjvm.so )
( cd usr/lib/mozilla/plugins ; rm -rf libjavaplugin_jni.so )
( cd usr/lib/mozilla/plugins ; ln -sf /usr/lib/java/jre/lib/i386/libjavaplugin_jni.so libjavaplugin_jni.so )
( cd usr/lib/mozilla/plugins ; rm -rf libnpjp2.so )
( cd usr/lib/mozilla/plugins ; ln -sf /usr/lib/java/jre/lib/i386/libnpjp2.so libnpjp2.so )
( cd usr/lib ; rm -rf jdk1.7.0_10 )
( cd usr/lib ; ln -sf java jdk1.7.0_10 )
( cd usr/lib/java/jre/bin ; rm -rf ControlPanel )
( cd usr/lib/java/jre/bin ; ln -sf jcontrol ControlPanel )
( cd usr/lib/java/jre/lib/i386/server ; rm -rf libjsig.so )
( cd usr/lib/java/jre/lib/i386/server ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib/java/jre/lib/i386/client ; rm -rf libjsig.so )
( cd usr/lib/java/jre/lib/i386/client ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib/java/bin ; rm -rf ControlPanel )
( cd usr/lib/java/bin ; ln -sf jcontrol ControlPanel )
( cd usr/lib/java/man ; rm -rf ja )
( cd usr/lib/java/man ; ln -sf ja_JP.UTF-8 ja )
