
# Clean up a potential upgrade mess caused by changing the
# installation directory to /usr/lib64/java/:
if [ -L usr/lib64/java ]; then
  rm -rf usr/lib64/java
  mkdir -p usr/lib64/java/man
  mkdir -p usr/lib64/java/jre/lib//server
  mkdir -p usr/lib64/java/jre/lib//client
  mkdir -p usr/lib64/java/jre/javaws
  mkdir -p usr/lib64/java/jre/bin
  mkdir -p usr/lib64/java/bin
  mkdir -p usr/lib64/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/lib64 ; rm -rf libjvm.so )
( cd usr/lib64 ; ln -sf ./java/jre/lib/amd64/server/libjvm.so libjvm.so )
( cd usr/lib64/mozilla/plugins ; rm -rf libjavaplugin_jni.so )
( cd usr/lib64/mozilla/plugins ; ln -sf /usr/lib64/java/jre/lib/amd64/libjavaplugin_jni.so libjavaplugin_jni.so )
( cd usr/lib64/mozilla/plugins ; rm -rf libnpjp2.so )
( cd usr/lib64/mozilla/plugins ; ln -sf /usr/lib64/java/jre/lib/amd64/libnpjp2.so libnpjp2.so )
( cd usr/lib64 ; rm -rf jdk1.7.0_09 )
( cd usr/lib64 ; ln -sf java jdk1.7.0_09 )
( cd usr/lib64/java/jre/lib/amd64/server ; rm -rf libjsig.so )
( cd usr/lib64/java/jre/lib/amd64/server ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib64/java/jre/bin ; rm -rf ControlPanel )
( cd usr/lib64/java/jre/bin ; ln -sf jcontrol ControlPanel )
( cd usr/lib64/java/man ; rm -rf ja )
( cd usr/lib64/java/man ; ln -sf ja_JP.UTF-8 ja )
( cd usr/lib64/java/bin ; rm -rf ControlPanel )
( cd usr/lib64/java/bin ; ln -sf jcontrol ControlPanel )
