if [ "x$ANDROID_SDK_HOME" = "x" ] ; then if [ ! -e setup-android.bash ] ; then echo "Unable to find 'setup-android.bash'. You either need to:" echo " 1) copy setup-android.bash.in to setup-android.bash and" echo " edit **ANDROID_SDK_HOME** to point to where this is located" echo " on your file system, or" echo " 2) Explicitly set the environment variable ANDROID_SDK_HOME" echo " and make sure 'dx' is on your PATH" exit else source setup-android.bash fi fi export IJETTY_HOME=`pwd` export IJOS=`uname | sed 's/^cygwin.*$/cygwin/i' | sed 's/^mingw.*$/mingw/i'` if [ "x$GSDL3HOME" = "x" ] ; then echo " Setting GSDL3HOME to '../../web'" export GSDL3HOME=../../web else echo "Using existing value of GSDL3HOME: '$GSDL3HOME'" fi if [ "x$SDCARD_WEBAPPS" = "x" ] ; then possible_drives="" if [ "x$IJOS" = "xcygwin" ] ; then possible_drives=`ls -d /cygdrive/*/jetty/webapps 2>/dev/null` elif [ "x$IJOS" = "xmingw" ] ; then possible_drives=`ls -d /*/jetty/webapps 2>/dev/null` else # Linux and MacOS possible_drives=`ls -d /mnt/*/jetty/webapps 2>/dev/null` fi num_possible_drives=`echo $possible_drives | wc -l` if [ $num_possible_drives = "0" ] ; then echo " Failed to automatically find and sdcard webapps folders" echo " Explicitly set the environment variable SDCARD_WEBAPPS to control" echo " installation on the Android phone" elif [ $num_possible_drives = "1" ] ; then export SDCARD_WEBAPPS=${possible_drives[0]} else echo " Detected more than one possible sdcard webapps folders:" echo " $possible_drives" echo " Explicitly set the environment variable SDCARD_WEBAPPS to control" echo " which one is used for installation on the Android phone" fi fi if [ "x$SDCARD_WEBAPPS" != "x" ] ; then export SDCARD_GSDL3HOME=$SDCARD_WEBAPPS/greenstone3/ echo "" echo " Using:" echo "" echo " $SDCARD_GSDL3HOME" echo "" echo " as the installation point for the Greenstone servlet" echo "" fi if [ "x$IJETTY_PORT" = "x" ] ; then export IJETTY_PORT=8080 echo "" echo " Setting IJETTY_PORT to 8080" echo " Explicityly set this environment variable to override this default" echo "" else echo "" echo " Using IJETTY PORT = $IJETTY_PORT" echo "" fi echo "+ Your environment has now been set up with iJetty extension for Greenstone" echo "" echo "======" echo "If this is the first time you have installed Greenstone on the Android device, " echo " run:" echo "" echo " adb install i-jetty-2.2-signed.apk" echo "" echo "to install jetty on your device, followed by" echo "" echo " ./WEBAPP-ROOT-TO-SDCARD.sh" echo "" echo "to set up tGreenstone's 'web' directory within the i-jetty webapps area." echo "Then:" echo "" echo " ./JAVA-TO-DEX.sh" echo "" echo "to cross-compile Greenstone java code to the Android DEX format." echo "" echo "Finally run:" echo "" echo " ./DEX-TO-SDCARD.sh" echo "" echo "to install the cross-compiled files on the Android device" echo "======" echo ""