source: main/trunk/greenstone3/gs3-check-cli.sh@ 37682

Last change on this file since 37682 was 36757, checked in by davidb, 20 months ago

Additional echo info added in

  • Property svn:executable set to *
File size: 1.4 KB
RevLine 
[36410]1#!/bin/bash
2
[36416]3function check_exists {
4 local prog_name=$1
5 local ext_name=$2
[36410]6
[36416]7 local status=0
[36410]8
[36416]9 echo ""
10 echo "Checking for '$prog_name'"
[36410]11
[36416]12 if type -p $prog_name > /dev/null ; then
13 echo " => Found $prog_name executable in PATH"
14 else
15 echo "****" 1>&2
16 echo "* Failed to find '$prog_name'" 1>&2
17 echo "*" 1>&2
[36420]18 echo "* => Consider running ext-cli/get-${ext_name}.sh" 1>&2
19 echo "* and then source ./gs3-setup-cli.sh" 1>&2
[36416]20 echo "****" 1>&2
21 echo "" 1>&2
22# echo "Exiting check sequence ..." 1>&2
23# echo "" 1>&2
24 status=1
25 fi
[36410]26
[36416]27 return $status
28}
[36410]29
[36420]30check_exists java "selfcontained-jdk"
31found_java=1
[36416]32
33check_exists ant "selfcontained-ant"
[36420]34found_ant=1
[36416]35
36check_exists javac "selfcontained-jdk"
[36420]37found_javac=1
[36416]38
[36420]39if [ $? != 0 ] ; then
40 if [ $found_java = 1 ] ; then
41 echo "Having found 'java' but not 'javac' means you can run Greenstone3, but not compile it"
42 fi
[36757]43else
44 # found javac
45 if [ "x$JAVA_HOME" ] ; then
46 echo ""
47 echo "Warning: JAVA_HOME not set, which means you will be unable to compile in JNI support"
48 fi
49
50 echo ""
51 echo "----"
52 echo "A typical compile sequence is:"
53 echo " ant"
54 echo " # review and edit (if required) build.properies"
55 echo " ant prepare"
56 echo " ant install"
57 echo "----"
[36420]58fi
[36416]59
[36757]60echo ""
61
62echo "----"
63echo "To start a Greenstone3 installation, enter:"
64echo " ant start"
65echo "----"
Note: See TracBrowser for help on using the repository browser.