source: gs2-extensions/afrepo/trunk/src/gs3-setup.sh@ 27263

Last change on this file since 27263 was 27263, checked in by davidb, 11 years ago

Require AMP extension to be sourced before this one.

  • Property svn:executable set to *
File size: 2.3 KB
RevLine 
[27255]1
2extdesc="the afrepo (audio-fingerprinting) Extension"
3
4full_setup=`pwd`/${BASH_SOURCE}
5fulldir=${full_setup%/*}
6fulldir=${fulldir%/.}
7
[27263]8# Dependency of AMP extension => source first
9if [ "x$GEXTAMP" = "x" ] ; then
10 pushd $fulldir > /dev/null
11 if [ -d ../amp/ ] ; then
12 store_extdesc=$extdesc
13 cd ../amp/ && source ./setup.bash
14 extdesc=$store_extdesc
15 fi
16 popd > /dev/null
17fi
18
[27255]19if test -z $GSDLOS ; then
20 GSDLOS=`uname -s | tr '[A-Z]' '[a-z]'`
21 # check for running bash under Cygwin
22 if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
23 then
24 GSDLOS=windows
25 fi
26 # check for running bash under MinGW/MSys
27 if test "`echo $GSDLOS | sed 's/mingw//'`" != "$GSDLOS" ;
28 then
29 GSDLOS=windows
30 fi
31 echo "GSDLOS was not set. Setting it to '$GSDLOS'"
32 export GSDLOS
33fi
34
35
36if [ "x$GEXT_AFREPO" = "x" ] ; then
37 export GEXT_AFREPO=`pwd`
38 export GEXT_AFREPO_INSTALLED=$GEXT_AFREPO/$GSDLOS
39
40 if [ -d "$GEXT_AFREPO_INSTALLED/bin/script" ] ; then
41 export PATH=$GEXT_AFREPO_INSTALLED/bin/script:$PATH
42 fi
43
44 if [ -d "$GEXT_AFREPO_INSTALLED/bin" ] ; then
45 export PATH=$GEXT_AFREPO_INSTALLED/bin:$PATH
46 fi
47
48 if [ -d "$GEXT_AFREPO_INSTALLED/lib" ] ; then
49 if [ "$GSDLOS" = "linux" ] ; then
50 export LD_LIBRARY_PATH=$GEXT_AFREPO_INSTALLED/lib:$GEXT_AFREPO_INSTALLED/lib64:$LD_LIBRARY_PATH
51 elif [ "$GSDLOS" = "darwin" ] ; then
52 export DYLD_LIBRARY_PATH=$GEXT_AFREPO_INSTALLED/lib:$GEXT_AFREPO_INSTALLED/lib64:$DYLD_LIBRARY_PATH
53 fi
54 fi
55
56 extdir=${GEXT_AFREPO##*/}
57
58 if [ "x$GSDLEXTS" = "x" ] ; then
59 export GSDLEXTS=$extdir
60 else
61 export GSDLEXTS=$GSDLEXTS:$extdir
62 fi
63
64
65 echo "+Your environment is now setup for $extdesc"
66else
67 echo "+Your environment is already setup for $extdesc"
68fi
[27263]69
70found_php_bin=0
71if [ "x$GEXTAMP" != "x" ] ; then
72
73 if [ -d "$GEXTAMP_INSTALLED/htdocs/afrepo/bin" ] ; then
74 export PATH=$GEXTAMP_INSTALLED/htdocs/afrepo/bin:$PATH
75 echo "+Your environment is now setup to run PHP scripts for $extdesc"
76 found_php_bin=1
77 fi
78fi
79
80if [ "$found_php_bin" = "0" ] ; then
81 echo "+ *** Warning: failed to find Apache's htdocs directory through GEXTAMP_INSTALLED"
82 echo "+ *** to add 'htdocs/afrepo/bin' to PATH to be able to run PHP scripts"
83 echo "+ *** from the command line"
84 echo "+ *** Assuming these scripts are somehow already on your PATH"
85fi
Note: See TracBrowser for help on using the repository browser.