[Lunar-commits] <moonbase> sun-jdk: improved build

Zbigniew Luszpinski zbiggy at lunar-linux.org
Sun Jul 18 22:29:23 CEST 2010


commit 285d67cf0e6d72b3b11ed2e9b9be7dcf50f24f9b
Author: Zbigniew Luszpinski <zbiggy at lunar-linux.org>
Date:   Sun Jul 18 22:29:23 2010 +0200

    sun-jdk: improved build
---
 compilers/sun-jdk/BUILD        |   61 +++++++++++++++++++++++--------------
 compilers/sun-jdk/BUILD.x86_64 |   65 ++++++++++++++++++++++++---------------
 2 files changed, 78 insertions(+), 48 deletions(-)

diff --git a/compilers/sun-jdk/BUILD b/compilers/sun-jdk/BUILD
index 24980b9..b40d50b 100644
--- a/compilers/sun-jdk/BUILD
+++ b/compilers/sun-jdk/BUILD
@@ -4,19 +4,31 @@
   ./$SOURCE --accept-license --unpack &&
 
   # Clean up old java 1.6.0 service packs
-  rm -rf /usr/lib/jdk1.6.0_* &&
+  rm -rf /usr/lib/j[rd][ek]1.6.0_* &&
+  rm -rf /usr/java &&
   rm -f /usr/lib/libjvm.so &&
 
   prepare_install &&
 
-  cp -r $SOURCE_DIRECTORY/jdk${FVERSION} /usr/lib/ &&
-
-  # Some apps only search for java in /usr/java
-  rm  -f /usr/java &&
-  ln -sf /usr/lib/jdk${FVERSION} /usr/java &&
+  # Install java to right directory
+  mkdir -p /usr/java &&
+  # This is default and recommended installation place for Java
+  cp -r $SOURCE_DIRECTORY/jdk${FVERSION} /usr/java &&
+  # Sun's recommended symlinks:
+  # This one _always_ points on latest Java release
+  ln -sf /usr/java/jdk${FVERSION} /usr/java/latest &&
+  # This one _always_ points on default Java.
+  # If not set manually by root it defaults to /usr/java/latest:
+  if [ ! -h /usr/java/default ]; then
+     ln -sf /usr/java/latest /usr/java/default
+  fi  &&
+
+  # Some dumb distros say java is only library so install it in /usr/lib
+  # We make symlink to help applications find java if they were developed in such ill environment
+  ln -sf /usr/java/jdk${FVERSION} /usr/lib/jdk${FVERSION} &&
 
   # Some applications don't accept anything but /usr/bin
-  for file in /usr/lib/jdk${FVERSION}/bin/*; do
+  for file in /usr/java/latest/bin/*; do
       bfile=`basename $file`
       # Conflicting files with heimdal
       if [[ "$bfile" != "klist" ]] && [[ "$bfile" != "kinit" ]]; then
@@ -25,22 +37,25 @@
   done &&
 
   mkdir -p /opt/lunar/plugins &&
-  rm -f /opt/lunar/plugins/libjavaplugin_oji.so &&
-  rm -f /opt/lunar/plugins/libnpjp2.so &&
-
-  if [ $NEWPLUGIN == 'y' ]; then
-  ln -sf /usr/lib/jdk${FVERSION}/jre/lib/i386/libnpjp2.so \
-         /opt/lunar/plugins/
-  else
-  ln -sf /usr/lib/jdk${FVERSION}/jre/plugin/i386/ns7/libjavaplugin_oji.so \
-         /opt/lunar/plugins/
-  fi &&
-
-# This didn't get created, dead link. Do it this way.
-  ln -sf /usr/lib/jdk${FVERSION}/jre/lib/i386/server/libjvm.so /usr/lib/libjvm.so &&
-
-  echo export PATH=\"'${PATH}':/usr/lib/jdk"${FVERSION}"/bin\" >> $SOURCE_DIRECTORY/sun-jdk.rc &&
-  echo export JAVA_HOME=\"/usr/lib/jdk"${FVERSION}"/\" >> $SOURCE_DIRECTORY/sun-jdk.rc &&
+  rm -f /opt/lunar/plugins/{libjavaplugin_oji.so,libnpjp2.so} &&
+
+  # Always use new plugin.
+  # Firefox 3, Seamonkey 2, Google chrome/inium use it
+  # KDE3/4 Konqueror and Opera always uses Java directly so do not use any plugin
+  # if [ $NEWPLUGIN == 'y' ]; then
+  ln -sf /usr/java/latest/jre/lib/i386/libnpjp2.so \
+         /opt/lunar/plugins/ &&
+  # else
+  # We do not have firefox 1/2 or Seamonkey 1 anymore so no browser uses old plugin
+  # ln -sf /usr/java/latest/jre/plugin/i386/ns7/libjavaplugin_oji.so \
+  #       /opt/lunar/plugins/
+  # fi &&
+
+  # This didn't get created, dead link. Do it this way.
+  ln -sf /usr/java/latest/jre/lib/i386/server/libjvm.so /usr/lib/libjvm.so &&
+
+  echo export JAVA_HOME=\"/usr/java/latest\" >> $SOURCE_DIRECTORY/sun-jdk.rc &&
+  echo export PATH=\"'$PATH':'$JAVA_HOME'/bin\" >> $SOURCE_DIRECTORY/sun-jdk.rc &&
   install -m644 $SOURCE_DIRECTORY/sun-jdk.rc /etc/profile.d/
 
 ) > $C_FIFO 2>&1
diff --git a/compilers/sun-jdk/BUILD.x86_64 b/compilers/sun-jdk/BUILD.x86_64
index 32da896..cacbf57 100644
--- a/compilers/sun-jdk/BUILD.x86_64
+++ b/compilers/sun-jdk/BUILD.x86_64
@@ -4,43 +4,58 @@
   ./$SOURCE --accept-license --unpack &&
 
   # Clean up old java 1.6.0 service packs
-  rm -rf /usr/lib/jdk1.6.0_* &&
+  rm -rf /usr/lib/j[rd][ek]1.6.0_* &&
+  rm -rf /usr/java &&
+  rm -f /usr/lib/libjvm.so &&
 
   prepare_install &&
 
-  cp -r $SOURCE_DIRECTORY/jdk${FVERSION} /usr/lib/ &&
-
-  # Some apps only search for java in /usr/java
-  rm  -f /usr/java &&
-  ln -sf /usr/lib/jdk${FVERSION} /usr/java &&
-
-# This didn't get created, dead link. Do it this way.
-  ln -sf /usr/lib/jdk${FVERSION}/jre/lib/amd64/server/libjvm.so /usr/lib/libjvm.so &&
+  # Install java to right directory
+  mkdir -p /usr/java &&
+  # This is default and recommended installation place for Java
+  cp -r $SOURCE_DIRECTORY/jdk${FVERSION} /usr/java &&
+  # Sun's recommended symlinks:
+  # This one _always_ points on latest Java release
+  ln -sf /usr/java/jdk${FVERSION} /usr/java/latest &&
+  # This one _always_ points on default Java.
+  # If not set manually by root it defaults to /usr/java/latest:
+  if [ ! -h /usr/java/default ]; then
+     ln -sf /usr/java/latest /usr/java/default
+  fi  &&
+
+  # Some dumb distros say java is only library so install it in /usr/lib
+  # We make symlink to help applications find java if they were developed in such ill environment
+  ln -sf /usr/java/jdk${FVERSION} /usr/lib/jdk${FVERSION} &&
 
   # Some applications don't accept anything but /usr/bin
-  for file in /usr/lib/jdk${FVERSION}/bin/*; do
+  for file in /usr/java/latest/bin/*; do
       bfile=`basename $file`
       # Conflicting files with heimdal
       if [[ "$bfile" != "klist" ]] && [[ "$bfile" != "kinit" ]]; then
           ln -sf $file /usr/bin/
       fi
-  done
+  done &&
 
   mkdir -p /opt/lunar/plugins &&
-  rm -f /opt/lunar/plugins/libjavaplugin_oji.so &&
-  rm -f /opt/lunar/plugins/libnpjp2.so &&
-
-  if [ $NEWPLUGIN == 'y' ]; then
-  ln -sf /usr/lib/jdk${FVERSION}/jre/lib/amd64/libnpjp2.so \
-         /opt/lunar/plugins/
-  else
-  ln -sf /usr/lib/jdk${FVERSION}/jre/plugin/amd64/libjavaplugin_jni.so \
-         /opt/lunar/plugins/
-  fi &&
-
-
-  echo export PATH=\"'${PATH}':/usr/lib/jdk"${FVERSION}"/bin\" >> $SOURCE_DIRECTORY/sun-jdk.rc &&
-  echo export JAVA_HOME=\"/usr/lib/jdk"${FVERSION}"/\" >> $SOURCE_DIRECTORY/sun-jdk.rc &&
+  rm -f /opt/lunar/plugins/{libjavaplugin_oji.so,libnpjp2.so} &&
+
+  # Always use new plugin.
+  # Firefox 3, Seamonkey 2, Google chrome/inium use it
+  # KDE3/4 Konqueror and Opera always uses Java directly so do not use any plugin
+  # if [ $NEWPLUGIN == 'y' ]; then
+  ln -sf /usr/java/latest/jre/lib/amd64/libnpjp2.so \
+         /opt/lunar/plugins/ &&
+  # else
+  # We do not have firefox 1/2 or Seamonkey 1 anymore so no browser uses old plugin
+  # ln -sf /usr/java/latest/jre/plugin/amd64/libjavaplugin_jni.so \
+  #       /opt/lunar/plugins/
+  # fi &&
+
+  # This didn't get created, dead link. Do it this way.
+  ln -sf /usr/java/latest/jre/lib/amd64/server/libjvm.so /usr/lib/libjvm.so &&
+
+  echo export JAVA_HOME=\"/usr/java/latest\" >> $SOURCE_DIRECTORY/sun-jdk.rc &&
+  echo export PATH=\"'$PATH':'$JAVA_HOME'/bin\" >> $SOURCE_DIRECTORY/sun-jdk.rc &&
   install -m644 $SOURCE_DIRECTORY/sun-jdk.rc /etc/profile.d/
 
 ) > $C_FIFO 2>&1


More information about the Lunar-commits mailing list