source: gs3-extensions/i-jetty/trunk/src/WEBAPP-ROOT-TO-SDCARD.sh@ 23970

Last change on this file since 23970 was 23970, checked in by davidb, 10 years ago

Mod/improvement to scripts based on fresh round of installing Greenstone on an Android phone

File size: 2.2 KB
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 echo " => Have you launched i-jetty to create the 'jetty' directory on the sd-card?
22
23echo "#---"
24echo "# $mode $GSDL3HOME -> $SDCARD_GSDL3HOME"
25echo "# (this may take several minutes)"
26echo "#---"
27echo ""
28
29if [ $mode = "Installing" ] ; then
30 (cd $GSDL3HOME && find . -type d ) \
31 | egrep -v '/\.svn' \
32 | egrep -v 'sites/' \
33 | egrep -v 'WEB-INF/classes' \
34 | egrep -v 'WEB-INF/lib' \
35 | xargs -I {} mkdir -p $SDCARD_GSDL3HOME/{}
36fi
37
38(cd $GSDL3HOME && find . -type f ) \
39 | egrep -v '/\.svn' \
40 | egrep -v 'sites/' \
41 | egrep -v 'WEB-INF/classes' \
42 | egrep -v 'WEB-INF/lib' \
43 | xargs -I {} /bin/cp -u -v $GSDL3HOME/{} $SDCARD_GSDL3HOME/{}
44
45/bin/cp resources/index.html $SDCARD_GSDL3HOME/.
46/bin/cp resources/web.xml $SDCARD_GSDL3HOME/WEB-INF/.
47
48if [ ! -d $SDCARD_GSDL3HOME/sites/localsite ] ; then
49 echo "Creating 'localsite' in $SDCARD_GSDLHOME"
50 mkdir $SDCARD_GSDL3HOME/sites/localsite
51 mkdir $SDCARD_GSDL3HOME/sites/localsite/collect
52fi
53
54/bin/cp -u -v $GSDL3HOME/sites/localsite/siteConfig.xml $SDCARD_GSDL3HOME/sites/localsite/.
55
56/bin/cp -u -v -r $GSDL3HOME/sites/localsite/etc $SDCARD_GSDL3HOME/sites/localsite/.
57
58/bin/cp -u -v -r $GSDL3HOME/sites/localsite/collect/lucene-jdbm-demo $SDCARD_GSDL3HOME/sites/localsite/collect/.
59
60if [ ! -d $SDCARD_GSDL3HOME/sites/localsite/collect/lucene-jdbm-demo/index ] ; then
61 pushd $SDCARD_GSDL3HOME/sites/localsite/collect/lucene-jdbm-demo
62 unzip index.zip
63 popd
64fi
65
66echo ""
67echo "####"
68echo "# If not already done so, run: "
69echo "# ./JAVA-TO-DEX.sh"
70echo "# to cross-compile the Greenstone code and supporting JAR files"
71echo "####"
72echo ""
73
74
75
Note: See TracBrowser for help on using the repository browser.