# Java(TM) expects /usr/bin/ls:
if [ ! -r /usr/bin/ls ]; then
  # one more won't hurt us:
  cp -a /bin/ls /usr/bin/ls
fi
for mozdir in `ls -d usr/lib/mozilla-*` ; do
  if [ -d "${mozdir}/plugins" ]; then
    # Mozilla needs this link to find Java(TM):
    ( cd ${mozdir}/plugins
      if [ ! -r libjavaplugin_oji.so ]; then
        ln -sf /usr/lib/j2re1.4.1_02/plugin/i386/ns610/libjavaplugin_oji.so .
      fi
    )
  fi
done
if [ -d usr/lib/netscape/plugins ]; then
  # Netscape needs this link to find Java(TM):
  ( cd usr/lib/netscape/plugins
    if [ ! -r libjavaplugin_oji.so ]; then
      ln -sf /usr/lib/j2re1.4.1_02/plugin/i386/ns610/libjavaplugin_oji.so .
    fi
  )
fi
# These links ship with Java(TM):
( cd usr/lib/j2re1.4.1_02/lib/i386/client ; rm -rf libjsig.so )
( cd usr/lib/j2re1.4.1_02/lib/i386/client ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib/j2re1.4.1_02/lib/i386/server ; rm -rf libjsig.so )
( cd usr/lib/j2re1.4.1_02/lib/i386/server ; ln -sf ../libjsig.so libjsig.so )
( cd usr/lib/j2re1.4.1_02/man ; rm -rf ja )
( cd usr/lib/j2re1.4.1_02/man ; ln -sf ja_JP.eucJP ja )
