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

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

Tweak to the 'afr' aliased commands

  • 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 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 alias afr-makelinks="makelinks"
57 alias afr-classify="classify"
58 alias afr-generateall="generateall"
59
60 extdir=${GEXT_AFREPO##*/}
61
62 if [ "x$GSDLEXTS" = "x" ] ; then
63 export GSDLEXTS=$extdir
64 else
65 export GSDLEXTS=$GSDLEXTS:$extdir
66 fi
67
68
69 echo "+Your environment is now setup for $extdesc"
70else
71 echo "+Your environment is already setup for $extdesc"
72fi
73
74found_php_bin=0
75if [ "x$GEXTAMP" != "x" ] ; then
76
77 if [ -d "$GEXTAMP_INSTALLED/htdocs/afrepo/bin" ] ; then
78 export PATH=$GEXTAMP_INSTALLED/htdocs/afrepo/bin:$PATH
79 echo "+Your environment is now setup to run PHP scripts for $extdesc"
80 found_php_bin=1
81 fi
82fi
83
84if [ "$found_php_bin" = "0" ] ; then
85 echo "+ *** Warning: failed to find Apache's htdocs directory through GEXTAMP_INSTALLED"
86 echo "+ *** to add 'htdocs/afrepo/bin' to PATH to be able to run PHP scripts"
87 echo "+ *** from the command line"
88 echo "+ *** Assuming these scripts are somehow already on your PATH"
89fi
Note: See TracBrowser for help on using the repository browser.