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

Last change on this file since 27338 was 27338, checked in by davidb, 8 years ago

aliases for 'afr-' programs to run upgraded to full scripts that 'cd' to the appropriate directory first

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1
2extdesc="the afrepo (audio-fingerprinting) Extension"
3
4full_setup=`pwd`/${BASH_SOURCE}
5fulldir=${full_setup%/*}
6fulldir=${fulldir%/.}
7
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
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 export PATH=$GEXT_AFREPO/bin/script:$PATH
49
50 if [ -d "$GEXT_AFREPO_INSTALLED/lib" ] ; then
51 if [ "$GSDLOS" = "linux" ] ; then
52 export LD_LIBRARY_PATH=$GEXT_AFREPO_INSTALLED/lib:$GEXT_AFREPO_INSTALLED/lib64:$LD_LIBRARY_PATH
53 elif [ "$GSDLOS" = "darwin" ] ; then
54 export DYLD_LIBRARY_PATH=$GEXT_AFREPO_INSTALLED/lib:$GEXT_AFREPO_INSTALLED/lib64:$DYLD_LIBRARY_PATH
55 fi
56 fi
57
58 extdir=${GEXT_AFREPO##*/}
59
60 if [ "x$GSDLEXTS" = "x" ] ; then
61 export GSDLEXTS=$extdir
62 else
63 export GSDLEXTS=$GSDLEXTS:$extdir
64 fi
65
66
67 echo "+Your environment is now setup for $extdesc"
68else
69 echo "+Your environment is already setup for $extdesc"
70fi
71
72found_php_bin=0
73if [ "x$GEXTAMP" != "x" ] ; then
74
75 if [ -d "$GEXTAMP_INSTALLED/htdocs/afrepo/bin" ] ; then
76 export PATH=$GEXTAMP_INSTALLED/htdocs/afrepo/bin:$PATH
77 echo "+Your environment is now setup to run PHP scripts for $extdesc"
78 found_php_bin=1
79 fi
80fi
81
82if [ "$found_php_bin" = "0" ] ; then
83 echo "+ *** Warning: failed to find Apache's htdocs directory through GEXTAMP_INSTALLED"
84 echo "+ *** to add 'htdocs/afrepo/bin' to PATH to be able to run PHP scripts"
85 echo "+ *** from the command line"
86 echo "+ *** Assuming these scripts are somehow already on your PATH"
87fi
Note: See TracBrowser for help on using the repository browser.