#!/bin/bash

source ../cascade-make/lib/cascade-lib.bash GEXT_JENA .. $*


if [ $install = "1"  ] ; then

  echo "===="
  echo "= Installing GS Triplestore Wrapper scripts (for Fuseki3)"
  echo "=="

  triple_store="$GEXT_JENA/etc/tdb-triple-store3"
  if [ ! -d "$triple_store" ] ; then
    echo "= Creating empty triple-store:"
    echo "    $triple_store"
    mkdir "$triple_store"

   /bin/cp tdb3.ttl "$GEXT_JENA/etc/."
  fi

  echo "= Installing server-side scripts"
  /bin/cp gs-triplestore-* $GEXT_JENA/bin/script3/.
  chmod a+rx $GEXT_JENA/bin/script3/gs-triplestore-*

#  echo "= Installing Greenstone-style CSS"
#  /bin/cp fuseki.css $GEXT_JENA/etc/pages/.
#  chmod a+r $GEXT_JENA/etc/pages/fuseki.css
  
  echo "= Transferring Fuseki-v1 XSL files to Fuseki-v3"
  /bin/cp "$GEXT_JENA/etc/pages/"*.xsl "$GEXT_JENA/packages/apache-jena-fuseki-3.17.0/webapp/."

  echo "===="
  echo ""

fi
