source: main/trunk/greenstone3/ext-cli/get-selfcontained-ant.sh@ 37350

Last change on this file since 37350 was 37350, checked in by davidb, 14 months ago

Changed to work more generic named PREPARE script, as Darwin is the same as Linux in the case

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/bash
2
3OS_ALLCAPS=`uname | tr 'a-z' 'A-Z'`
4
5selfcon_ext=selfcontained-ant
6installed_dir=${selfcon_ext}/apache-ant
7
8if [ ! -d selfcontained-jdk ] ; then
9 echo ""
10 echo "Checking for java ..."
11 command -v java
12
13 if [ $? != 0 ] ; then
14 echo ""
15 echo "Failed to find 'java'"
16 echo "After 5 seconds, initiating: "
17 echo ""
18 echo " ./get-selfcontained-jdk.sh"
19 echo "[Press ^C to stop]"
20 sleep 5
21 ./get-selfcontained-jdk.sh
22 else
23 echo ""
24 echo "Detected 'java' but it is not the Greenstone3 supplied 'selfcontained-jdk'"
25 echo "=> Recommend running:"
26 echo ""
27 echo " ./get-selfcontained-jdk.sh"
28 echo ""
29 echo "After 5 seconds, continuing with getting ant"
30 echo "[Press ^C to stop]"
31 sleep 5
32 fi
33fi
34
35echo ""
36if [ ! -d $selfcon_ext ] ; then
37 echo "Checking out from svn: Greenstone3's $selfcon_ext extension"
38 svn co https://svn.greenstone.org/gs3-extensions/$selfcon_ext/trunk $selfcon_ext
39
40 if [ $? != 0 ] ; then
41 echo "Error encountered checking out: " 1>&2
42 echo " svn co https://svn.greenstone.org/gs3-extensions/$selfcon_ext/trunk $selfcon_ext" 1>&2
43 exit 1
44 fi
45else
46 echo "Detected directory '$selfcon_ext'"
47 echo "=> Taken to mean that the svn check-out command has already been run"
48fi
49
50echo ""
51if [ ! -d $installed_dir ] ; then
52 echo "Runing the $selfcon_ext/PREPARE-UNIX.sh"
53
54 cd $selfcon_ext && ./PREPARE-UNIX.sh
55
56 if [ $? != 0 ] ; then
57 echo "Error encountered running: " 1>&2
58 echo " cd $selfcon_ext && ./PREPARE-UNIX.sh" 1>&2
59 exit 1
60 fi
61
62else
63 echo "Detected directory '$installed_dir'"
64 echo "=> Taken to mean that the $selfcon_ext/PREPARE-UNIX.sh command has already been run"
65fi
66
67
68if [ "x$ANT_HOME" != "x$PWD/$installed_dir" ] ; then
69 echo ""
70 echo "To use this installed version of Apache Ant, in the top-level Greenstone3 directory run:"
71 echo " source ./gs3-setup-cli.sh"
72 echo ""
73else
74 echo ""
75 echo "Detected ANT_HOME set to \$PWD/$installed_dir"
76 echo "=> Taken to mean that the $selfcon_ext SETUP.sh file has been sourced"
77fi
78
79echo ""
Note: See TracBrowser for help on using the repository browser.