# 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/lib/amd64/server
  mkdir -p usr/lib/java/lib64/amd64/client
  mkdir -p usr/lib64/java/javaws
  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/java/bin ; rm -rf ControlPanel )
( cd usr/lib64/java/bin ; ln -sf ./jcontrol ControlPanel )
( cd usr/lib64/java/lib/amd64/server ; rm -rf libjsig.so )
( cd usr/lib64/java/lib/amd64/server ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib64/java/man ; rm -rf ja )
( cd usr/lib64/java/man ; ln -sf ja_JP.eucJP ja )
( cd usr/lib64/java/javaws ; rm -rf javaws )
( cd usr/lib64/java/javaws ; ln -sf ../bin/javaws javaws )
( cd usr/lib64 ; rm -rf jre1.6.0_13 )
( cd usr/lib64 ; ln -sf java jre1.6.0_13 )
( cd usr/lib64/mozilla/plugins ; rm -rf libnpjp2.so )
( cd usr/lib64/mozilla/plugins ; ln -sf /usr/lib64/java/lib/amd64/libnpjp2.so libnpjp2.so )
