## These variables need to exist
set prefix=@prefix@
set exec_prefix=@exec_prefix@
set datarootdir=@datarootdir@
set texdatadir=`echo "@datadir@" | sed -e 's:/\+:/:g'`

## Try to automatically work out the YODA Python path
set YODA_PYTHONPATH="@YODA_PYTHONPATH@"
test -n "$YODA_PYTHONPATH" || (which yoda-config > /dev/null) && set YODA_PYTHONPATH="`yoda-config --pythonpath`"
test -n "$YODA_PYTHONPATH" || echo "yoda-config could not be found: you may need to manually set paths to libYODA and the yoda Python package" 1>&2

setenv PATH "$exec_prefix/bin:@YODABINPATH@:$PATH"

if ($?@LIBPATHVARNAME@) then
setenv @LIBPATHVARNAME@ "@libdir@:@YODALIBPATH@:@HEPMCLIBPATH@:@FASTJETLIBPATH@:@FJCONTRIBLIBPATH@:$@LIBPATHVARNAME@"
else
setenv @LIBPATHVARNAME@ "@libdir@:@YODALIBPATH@:@HEPMCLIBPATH@:@FASTJETLIBPATH@:@FJCONTRIBLIBPATH@"
endif

if ($?PYTHONPATH) then
setenv PYTHONPATH "@RIVET_PYTHONPATH@:${YODA_PYTHONPATH}:$PYTHONPATH"
else
setenv PYTHONPATH "@RIVET_PYTHONPATH@:$YODA_PYTHONPATH"
endif

if ($?TEXMFHOME) then
setenv TEXMFHOME "$texdatadir/Rivet/texmf:$TEXMFHOME"
else
setenv TEXMFHOME "$texdatadir/Rivet/texmf"
endif

if ($?HOMETEXMF) then
setenv HOMETEXMF "$texdatadir/Rivet/texmf:$HOMETEXMF"
else
setenv HOMETEXMF "$texdatadir/Rivet/texmf"
endif

if ($?TEXMFCNF) then
setenv TEXMFCNF "$texdatadir/Rivet/texmf/cnf:$TEXMFCNF"
else
setenv TEXMFCNF "$texdatadir/Rivet/texmf/cnf:"
endif

if ($?TEXINPUTS) then
setenv TEXINPUTS "$texdatadir/Rivet/texmf/tex//:$TEXINPUTS"
else
setenv TEXINPUTS "$texdatadir/Rivet/texmf/tex//:"
endif

if ($?LATEXINPUTS) then
setenv LATEXINPUTS "$texdatadir/Rivet/texmf/tex//:$LATEXINPUTS"
else
setenv LATEXINPUTS "$texdatadir/Rivet/texmf/tex//:"
endif

unset YODA_PYTHONPATH
