#!/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 "****** Test to see if 'audio-files' exists => generate message if not? ==> auto run cmd ???"

./INSTALL-PHP.sh


$GEXT_AFREPO/AFR-README.sh

