root/gs3-extensions/i-jetty/trunk/src/WEBAPP-ROOT-TO-SDCARD.sh @ 25607

Revision 25607, 2.1 KB (checked in by davidb, 7 years ago)

White space tidy-up

Line 
1#!/bin/bash
2
3if [ "x$SDCARD_WEBAPPS" = "x" ] ; then
4  echo "Environment variable SDCARD_WEBAPPS undefined"
5  echo "  => No valid directory to install to on Android device"
6  echo "  => Did you run setup.bash before the Android device was in disk mode?"
7  echo "  => Have you launched i-jetty at least once to create the 'jetty' directory on the sd-card?"
8  echo "  => If all else fails, you can set the environment variable SDCARD_WEBAPPS explicitly"
9  exit -1
10fi
11
12
13if [ ! -d $SDCARD_GSDL3HOME ] ; then
14  # First time install has been run => do a full copy
15  mode="Installing"
16
17else
18  # Only need to regenerate 'lib' folder
19  mode="Updating"
20fi
21
22echo "#---"
23echo "# $mode $GSDL3HOME -> $SDCARD_GSDL3HOME"
24echo "# (this may take several minutes)"
25echo "#---"
26echo ""
27
28if [ $mode = "Installing" ] ; then
29  (cd $GSDL3HOME && find . -type d ) \
30    | egrep -v '/\.svn' \
31    | egrep -v 'sites/' \
32    | egrep -v 'WEB-INF/classes' \
33    | egrep -v 'WEB-INF/lib' \
34    | xargs -I {} mkdir -p $SDCARD_GSDL3HOME/{}
35fi
36
37(cd $GSDL3HOME && find . -type f ) \
38  | egrep -v '/\.svn' \
39  | egrep -v 'sites/' \
40  | egrep -v 'WEB-INF/classes' \
41  | egrep -v 'WEB-INF/lib' \
42  | xargs -I {} /bin/cp -u -v $GSDL3HOME/{} $SDCARD_GSDL3HOME/{}
43
44/bin/cp resources/index.html $SDCARD_GSDL3HOME/.
45/bin/cp resources/web.xml $SDCARD_GSDL3HOME/WEB-INF/.
46
47if [ ! -d $SDCARD_GSDL3HOME/sites/localsite ] ; then
48  echo "Creating 'localsite' in $SDCARD_GSDLHOME"
49  mkdir $SDCARD_GSDL3HOME/sites/localsite
50  mkdir $SDCARD_GSDL3HOME/sites/localsite/collect
51fi
52
53/bin/cp -u -v $GSDL3HOME/sites/localsite/siteConfig.xml $SDCARD_GSDL3HOME/sites/localsite/.
54
55/bin/cp -u -v -r $GSDL3HOME/sites/localsite/etc $SDCARD_GSDL3HOME/sites/localsite/.
56
57/bin/cp -u -v -r $GSDL3HOME/sites/localsite/collect/lucene-jdbm-demo $SDCARD_GSDL3HOME/sites/localsite/collect/.
58
59if [ ! -d $SDCARD_GSDL3HOME/sites/localsite/collect/lucene-jdbm-demo/index ] ; then
60  pushd $SDCARD_GSDL3HOME/sites/localsite/collect/lucene-jdbm-demo
61  unzip index.zip
62  popd
63fi
64
65echo ""
66echo "####"
67echo "# If not already done so, run: "
68echo "#   ./JAVA-TO-DEX.sh"
69echo "# to cross-compile the Greenstone code and supporting JAR files"
70echo "####"
71echo ""
72
73
74
Note: See TracBrowser for help on using the browser.