The following commit has been merged in the master branch:
commit e3c0f17203ac8d3554cd8b5a564b4741452673d6
Author: Mònica Ramírez Arceda <mon...@probeta.net>
Date:   Sun Jun 26 00:22:24 2011 +0200

    Improve wrapper script: now it's based on josm wrapper script. Add -Xmx512M 
option.

diff --git a/debian/mkgmapgui.sh b/debian/mkgmapgui.sh
index 633658b..f1f07f4 100755
--- a/debian/mkgmapgui.sh
+++ b/debian/mkgmapgui.sh
@@ -1,2 +1,36 @@
 #!/bin/sh
-java -jar /usr/share/mkgmapgui/mkgmapgui.jar /usr/share/mkgmap/mkgmap.jar
+# Simple wrapper script used to start mkgmapgui in Debian
+set -e
+
+# First, the alternative (if known to work) or users preference as defined by 
$JAVA_HOME. Next, use OpenJDK or Sun's proprietary JDK.
+# Override to a specific one using $JAVACMD
+ALTERNATIVE_JDK="`readlink -n -f /etc/alternatives/java`"
+
+# If OpenJDK 6 is only available headless, do not try it
+if dpkg --get-selections openjdk-6-jre | grep install$ > /dev/null ; then
+   JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-6-openjdk/bin/java 
/usr/lib/jvm/java-6-sun/bin/java"
+else
+   JAVA_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-6-sun/bin/java"
+fi
+
+JAVA_OPTS="$JAVA_OPTS -Xmx512M"
+
+for jcmd in $JAVA_CMDS; do
+   if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" 
]; then
+      JAVACMD="$jcmd"
+   fi
+done
+
+for jcmd in $JAVA_CMDS; do
+   if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
+      JAVACMD="$jcmd"
+   fi
+done
+
+if [ "$JAVACMD" ]; then
+   echo "Using $JAVACMD to execute mkgmapgui."
+   exec $JAVACMD $JAVA_OPTS -jar /usr/share/mkgmapgui/mkgmapgui.jar 
/usr/share/mkgmap/mkgmap.jar
+else
+   echo "No valid JVM found to run mkgmapgui."
+   exit 1
+fi

-- 
Gui for mkgmap

_______________________________________________
Pkg-osm-commits mailing list
Pkg-osm-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-osm-commits

Reply via email to