With the provided ganttproject.sh seems that's not possible to launch GanttProject but from the same directory (i.e. ln -s /some/dir/ganttproject.sh /usr/local/bin and then launching ganttproject.sh fails)
Attached a modified script that should work.
Anonymous
modified ganttproject.sh
Hi, I just had the same idea, and did the search recursively, until original is found. With a little debugging stuff the patch for version 2.0.10 is, i will attach the file if possible, too.
3,5c3
< GP_HOME=.
< COMMAND_PATH=
echo ${0} | sed -e "s/\(.*\)\/.*$/\1/g"
< cd ${COMMAND_PATH}
Did not find a possiblility to uplad file here, so here it is:
::::::::::::::
ganttproject.sh
::::::::::::::
!/bin/bash
DEBUG="true"
STARTSCRIPT="$0"
check if this is a link to startscript, in case use target
do this recursively until original file location is found...
while [ -h "$STARTSCRIPT" ]
do
STARTSCRIPT=
readlink "$STARTSCRIPT"
if [ "$DEBUG" == "true" ]
then
echo checking for ganttproject install location: $STARTSCRIPT
fi
done
GP_HOME=
dirname "$STARTSCRIPT"
COMMAND_PATH=
echo ${0} | sed -e "s/\(.*\)\/.*$/\1/g"
cd ${COMMAND_PATH}
cd to directory, otherwise ganttproject-eclipsito-config.xml will not be found
cd "$GP_HOME"
LOCAL_CLASSPATH="./eclipsito.jar"
CONFIGURATION_FILE="ganttproject-eclipsito-config.xml"
BOOT_CLASS=org.bardsoftware.eclipsito.Boot
LOG_FILE=$HOME/.ganttproject.log
if [ -z $JAVA_HOME ]; then
JAVA_COMMAND=
which java
if [ "$?" = "1" ]; then
echo "No executable java found. Please set JAVA_HOME variable";
exit;
fi
else
JAVA_COMMAND=$JAVA_HOME/bin/java
fi
if [ ! -x $JAVA_COMMAND ]; then
echo "$JAVA_COMMAND is not executable. Please check the permissions."
exit
fi
if [ -e $LOG_FILE ] && [ ! -w $LOG_FILE ]; then
echo "Log file $LOG_FILE is not writable"
exit
fi
if [ "$DEBUG" == "true" ]
then
echo $JAVA_COMMAND -Xmx256m -classpath $CLASSPATH:$LOCAL_CLASSPATH $BOOT_CLASS $CONFIGURATION_FILE -log $LOG_FILE "$@"
fi
$JAVA_COMMAND -Xmx256m -classpath $CLASSPATH:$LOCAL_CLASSPATH $BOOT_CLASS $CONFIGURATION_FILE -log $LOG_FILE "$@"
The proposed patch would break "in-place" execution of ganttproject. Also, not all platforms have the 'readlink' command (are you sure you really want to follow the symbolic link references?)
Currently, I've had to modify ganttproject so that the class path found by ${GP_HOME} includes the dist-bin subdirectory, i.e.:
diff -r 8091b35479c9 ganttproject-builder/ganttproject
--- a/ganttproject-builder/ganttproject Tue Jul 03 15:34:45 2012 +0400
+++ b/ganttproject-builder/ganttproject Mon Jul 09 10:39:58 2012 -0700
@@ -44,7 +44,7 @@
exit 1
fi
-LOCAL_CLASSPATH=${GP_HOME}/eclipsito.jar:${GP_HOME}
+LOCAL_CLASSPATH=${GP_HOME}/dist-bin/eclipsito.jar:${GP_HOME}/dist-bin
CONFIGURATION_FILE=ganttproject-eclipsito-config.xml
BOOT_CLASS=org.bardsoftware.eclipsito.Boot
You don't need dist-bin in the classpath. You just need to run ganttproject script which sits in dist-bin/. dist-bin is what subsequently is zipped into zip distribution.
readlink doesn't work the way we want on Mac but that's a minor problem.
This issue tracker is deprecated, please use issue tracker on Google Code: http://code.google.com/p/ganttproject/issues/list