1 |
|
---|
2 | if [ "x$ANDROID_SDK_HOME" = "x" ] ; then
|
---|
3 | if [ ! -e setup-android.bash ] ; then
|
---|
4 | echo "Unable to find 'setup-android.bash'. You either need to:"
|
---|
5 | echo " 1) copy setup-android.bash.in to setup-android.bash and"
|
---|
6 | echo " edit **ANDROID_SDK_HOME** to point to where this is located"
|
---|
7 | echo " on your file system, or"
|
---|
8 | echo " 2) Explicitly set the environment variable ANDROID_SDK_HOME"
|
---|
9 | echo " and make sure 'dx' is on your PATH"
|
---|
10 | exit
|
---|
11 | else
|
---|
12 | source setup-android.bash
|
---|
13 | fi
|
---|
14 | fi
|
---|
15 |
|
---|
16 | export IJETTY_HOME=`pwd`
|
---|
17 | export IJOS=`uname | sed 's/^cygwin.*$/cygwin/i' | sed 's/^mingw.*$/mingw/i'`
|
---|
18 |
|
---|
19 | if [ "x$GSDL3HOME" = "x" ] ; then
|
---|
20 | echo " Setting GSDL3HOME to '../../web'"
|
---|
21 | export GSDL3HOME=../../web
|
---|
22 | else
|
---|
23 | echo "Using existing value of GSDL3HOME: '$GSDL3HOME'"
|
---|
24 | fi
|
---|
25 |
|
---|
26 | if [ "x$SDCARD_WEBAPPS" = "x" ] ; then
|
---|
27 |
|
---|
28 | possible_drives=""
|
---|
29 | if [ "x$IJOS" = "xcygwin" ] ; then
|
---|
30 |
|
---|
31 | possible_drives=`ls -d /cygdrive/*/jetty/webapps 2>/dev/null`
|
---|
32 | elif [ "x$IJOS" = "xmingw" ] ; then
|
---|
33 | possible_drives=`ls -d /*/jetty/webapps 2>/dev/null`
|
---|
34 | else
|
---|
35 | # Linux and MacOS
|
---|
36 | possible_drives=`ls -d /mnt/*/jetty/webapps 2>/dev/null`
|
---|
37 | fi
|
---|
38 |
|
---|
39 | num_possible_drives=`echo $possible_drives | wc -l`
|
---|
40 |
|
---|
41 | if [ $num_possible_drives = "0" ] ; then
|
---|
42 | echo " Failed to automatically find and sdcard webapps folders"
|
---|
43 | echo " Explicitly set the environment variable SDCARD_WEBAPPS to control"
|
---|
44 | echo " installation on the Android phone"
|
---|
45 | elif [ $num_possible_drives = "1" ] ; then
|
---|
46 | export SDCARD_WEBAPPS=${possible_drives[0]}
|
---|
47 | else
|
---|
48 | echo " Detected more than one possible sdcard webapps folders:"
|
---|
49 | echo " $possible_drives"
|
---|
50 | echo " Explicitly set the environment variable SDCARD_WEBAPPS to control"
|
---|
51 | echo " which one is used for installation on the Android phone"
|
---|
52 | fi
|
---|
53 | fi
|
---|
54 |
|
---|
55 | if [ "x$SDCARD_WEBAPPS" != "x" ] ; then
|
---|
56 | export SDCARD_GSDL3HOME=$SDCARD_WEBAPPS/greenstone3/
|
---|
57 | echo ""
|
---|
58 | echo " Using:"
|
---|
59 | echo ""
|
---|
60 | echo " $SDCARD_GSDL3HOME"
|
---|
61 | echo ""
|
---|
62 | echo " as the installation point for the Greenstone servlet"
|
---|
63 | echo ""
|
---|
64 | fi
|
---|
65 |
|
---|
66 |
|
---|
67 | if [ "x$IJETTY_PORT" = "x" ] ; then
|
---|
68 | export IJETTY_PORT=8080
|
---|
69 | echo ""
|
---|
70 | echo " Setting IJETTY_PORT to 8080"
|
---|
71 | echo " Explicityly set this environment variable to override this default"
|
---|
72 | echo ""
|
---|
73 | else
|
---|
74 | echo ""
|
---|
75 | echo " Using IJETTY PORT = $IJETTY_PORT"
|
---|
76 | echo ""
|
---|
77 | fi
|
---|
78 |
|
---|
79 | echo "+ Your environment has now been set up with iJetty extension for Greenstone"
|
---|
80 |
|
---|
81 | echo ""
|
---|
82 | echo "======"
|
---|
83 | echo "If this is the first time you have installed Greenstone on the Android device, "
|
---|
84 | echo " run:"
|
---|
85 | echo ""
|
---|
86 | echo " adb install i-jetty-2.2-signed.apk"
|
---|
87 | echo ""
|
---|
88 | echo "to install jetty on your device, followed by"
|
---|
89 | echo ""
|
---|
90 | echo " ./WEBAPP-ROOT-TO-SDCARD.sh"
|
---|
91 | echo ""
|
---|
92 | echo "to set up tGreenstone's 'web' directory within the i-jetty webapps area."
|
---|
93 | echo "Then:"
|
---|
94 | echo ""
|
---|
95 | echo " ./JAVA-TO-DEX.sh"
|
---|
96 | echo ""
|
---|
97 | echo "to cross-compile Greenstone java code to the Android DEX format."
|
---|
98 | echo ""
|
---|
99 | echo "Finally run:"
|
---|
100 | echo ""
|
---|
101 | echo " ./DEX-TO-SDCARD.sh"
|
---|
102 | echo ""
|
---|
103 | echo "to install the cross-compiled files on the Android device"
|
---|
104 | echo "======"
|
---|
105 | echo ""
|
---|
106 |
|
---|
107 |
|
---|
108 |
|
---|
109 |
|
---|
110 |
|
---|
111 |
|
---|