changeset 87:ef24043734ee

add symlinks under JDK_HOME/jre/bin and make javaws work without them too 2010-12-15 Omair Majid <omajid@redhat.com> * Makefile.am (install-exec-local): Install plugin.jar as data. If $(prefix)/jre/bin exists, then install symlinks to real javaws and itweb-settings binaries under it. ($(NETX_DIR)/launcher/%.o): Set system property java.icedtea-web.bin to point to the installed location of the javaws binary. * netx/net/sourceforge/jnlp/Launcher.java (launchExternal): Use the system property java.icedtea-web.bin to locate javaws binary.
author Omair Majid <omajid@redhat.com>
date Wed, 15 Dec 2010 10:17:51 -0500
parents a1ed62aa5f98
children e84432bca9a3
files ChangeLog Makefile.am netx/net/sourceforge/jnlp/Launcher.java
diffstat 3 files changed, 40 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jan 24 10:13:01 2011 -0500
+++ b/ChangeLog	Wed Dec 15 10:17:51 2010 -0500
@@ -1,3 +1,14 @@
+2010-12-15  Omair Majid  <omajid@redhat.com>
+
+	* Makefile.am
+	(install-exec-local): Install plugin.jar as data. If $(prefix)/jre/bin
+	exists, then install symlinks to real javaws and itweb-settings binaries
+	under it.
+	($(NETX_DIR)/launcher/%.o): Set system property java.icedtea-web.bin to
+	point to the installed location of the javaws binary.
+	* netx/net/sourceforge/jnlp/Launcher.java (launchExternal): Use the system
+	property java.icedtea-web.bin to locate javaws binary.
+
 2011-01-24  Omair Majid  <omajid@redhat.com>
 
 	* NEWS: Change format again.
--- a/Makefile.am	Mon Jan 24 10:13:01 2011 -0500
+++ b/Makefile.am	Wed Dec 15 10:17:51 2010 -0500
@@ -106,12 +106,28 @@
 if ENABLE_PLUGIN
 	${INSTALL_PROGRAM} $(PLUGIN_DIR)/IcedTeaPlugin.so $(DESTDIR)$(prefix)/jre/lib/$(INSTALL_ARCH_DIR)/
 	${INSTALL_PROGRAM} $(PLUGIN_DIR)/launcher/pluginappletviewer $(DESTDIR)$(bindir)
-	${INSTALL_PROGRAM} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/plugin.jar
+	${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/plugin.jar
 endif
 	${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(prefix)/jre/lib/netx.jar
 	${INSTALL_PROGRAM} $(NETX_DIR)/launcher/javaws $(DESTDIR)$(bindir)
+	if [ -d $(DESTDIR)$(prefix)/jre/bin ] ; then \
+	  if [ -L $(DESTDIR)$(prefix)/jre/bin/javaws ] ; then \
+	    rm -f $(DESTDIR)$(prefix)/jre/bin/javaws ; \
+	  fi ; \
+	  if [ ! -e $(prefix)/jre/bin/javaws ] ; then \
+	    ln -s $(DESTDIR)$(bindir)/javaws $(DESTDIR)$(prefix)/jre/bin ; \
+	  fi ; \
+	fi
 	${INSTALL_DATA} extra-lib/about.jar $(DESTDIR)$(prefix)/jre/lib
 	${INSTALL_PROGRAM} $(NETX_DIR)/launcher/controlpanel/itweb-settings $(DESTDIR)$(bindir)
+	if [ -d $(DESTDIR)$(prefix)/jre/bin ] ; then \
+	  if [ -L $(DESTDIR)$(prefix)/jre/bin/itweb-settings ] ; then \
+	    rm -f $(DESTDIR)$(prefix)/jre/bin/itweb-settings ; \
+	  fi ; \
+	  if [ ! -e $(prefix)/jre/bin/itweb-settings ] ; then \
+	    ln -s $(DESTDIR)$(bindir)/itweb-settings $(DESTDIR)$(prefix)/jre/bin ; \
+	  fi ; \
+	fi
 
 install-data-local:
 	${mkinstalldirs} -d $(DESTDIR)$(prefix)/man/man1
@@ -142,7 +158,14 @@
 	rm -f $(DESTDIR)$(prefix)/man/man1/javaws.1
 	rm -f $(DESTDIR)$(bindir)/pluginappletviewer
 	rm -f $(DESTDIR)$(bindir)/javaws
+	if [ -L $(DESTDIR)$(prefix)/jre/bin/javaws ] ; then \
+	  rm -f $(DESTDIR)$(prefix)/jre/bin/javaws ; \
+	fi
+	rm -f $(DESTDIR)$(prefix)/jre/bin/javaws
 	rm -f $(DESTDIR)$(bindir)/itweb-settings
+	if [ -L $(DESTDIR)$(prefix)/jre/bin/itweb-settings ] ; then \
+	  rm -f $(DESTDIR)$(prefix)/jre/bin/itweb-settings ; \
+	fi
 	rm -rf $(DESTDIR)$(htmldir)
 
 # Plugin
@@ -325,8 +348,9 @@
 
 $(NETX_DIR)/launcher/%.o: $(LAUNCHER_SRCDIR)/%.c
 	mkdir -p $(NETX_DIR)/launcher && \
-	$(CC) $(LAUNCHER_FLAGS) -DJAVA_ARGS='{ "-J-ms8m", "net.sourceforge.jnlp.runtime.Boot",  }' -DPROGNAME='"javaws"' \
-	-c -o $@ $<
+	$(CC) $(LAUNCHER_FLAGS) \
+	  -DJAVA_ARGS='{ "-J-ms8m", "-J-Djava.icedtea-web.bin=$(DESTDIR)$(bindir)/javaws", "net.sourceforge.jnlp.runtime.Boot",  }' \
+	  -DPROGNAME='"javaws"' -c -o $@ $<
 
 $(NETX_DIR)/launcher/controlpanel/%.o: $(LAUNCHER_SRCDIR)/%.c
 	mkdir -p $(NETX_DIR)/launcher/controlpanel && \
--- a/netx/net/sourceforge/jnlp/Launcher.java	Mon Jan 24 10:13:01 2011 -0500
+++ b/netx/net/sourceforge/jnlp/Launcher.java	Wed Dec 15 10:17:51 2010 -0500
@@ -329,11 +329,8 @@
 
             List<String> commands = new LinkedList<String>();
 
-            String pathToWebstartBinary = System.getProperty("java.home") +
-                                      File.separatorChar +
-                                      "bin" +
-                                      File.separatorChar +
-                                      "javaws";
+            // this property is set by the javaws launcher to point to the javaws binary
+            String pathToWebstartBinary = System.getProperty("java.icedtea-web.bin");
             commands.add(pathToWebstartBinary);
             // use -Jargument format to pass arguments to the JVM through the launcher
             for (String arg : vmArgs) {