#!/bin/sh package=afrepo version=-git-all-april2013 srcdir=$package$version if [ ! -d "$srcdir" ] ; then tar xvzf $srcdir.tar.gz fi echo "" echo "+ Testing for existing Greenstone extensions for AMP and echoprint" if [ "x$GEXTAMP" = "x" ] ; then echo "" echo "Error: Failed to find PHP-configured Apache httpd (GEXTAMP) extension" echo "" else echo "++ Found GEXTAMP: $GEXTAMP" fi if [ "x$GEXT_ECHOPRINT" = "x" ] ; then echo "" echo "Error: Failed to find GEXT_ECHOPRINT extension" echo "" else echo "++ Found GEXT_ECHOPRINT: $GEXT_ECHOPRINT" fi if [ ! -h $GEXTAMP_INSTALLED/htdocs/afrepo ] ; then echo "++ Creating symbolic link GEXTAMP_INSTALLED/htdocs/afrepo -> $srcdir" ln -s `pwd`/$srcdir $GEXTAMP_INSTALLED/htdocs/afrepo fi echo "" echo "What about Override apache settings ?????" echo "****** Test to see if 'audiofiles' exists => generate message if not? ==> auto run cmd ???" protocol=http hostname=`hostname` port=`egrep "^Listen" $GEXTAMP_INSTALLED/conf/httpd.conf | awk '{print $2}'` f4store_port=`echo $port+1 | bc` has_afrepo_conf=`egrep "^Include conf/httpd-afrepo.conf" "$GEXTAMP_INSTALLED/conf/httpd.conf"` if [ "x$has_afrepo_conf" = "x" ] ; then # Not currently in file => append it echo "Include conf/httpd-afrepo.conf" >> "$GEXTAMP_INSTALLED/conf/httpd.conf" fi cat "httpd-afrepo.conf.in" \ | sed "s%@4store-http-prefix@%$protocol://$hostname:$f4store_port%g" > "$GEXTAMP_INSTALLED/conf/httpd-afrepo.conf" cat "AFRepo.GSDLEXT.class.php.in" \ | sed "s%@afrepo-http-prefix@%$protocol://$hostname:$port%g" \ | sed "s%@4store-http-prefix@%$protocol://$hostname:$f4store_port%g" > "$GEXTAMP_INSTALLED/htdocs/afrepo/AFRepo.class.php" cat DONE.txt \ | sed "s%@GEXTAMP_INSTALLED@%$GEXTAMP_INSTALLED%g" \ | sed "s%@4store-port@%$f4store_port%g" \ | sed "s%@afrepo-http-prefix@%$protocol://$hostname:$port%g"