#!/bin/bash

# Install file for PyXPlot version 0.5.8
# Dominic Ford
# 09/09/2006

# Find python.

if { PYTHON_COMMAND=`which python2.4`; } ; then
   echo "PYTHON_COMMAND=${PYTHON_COMMAND}" > Makefile
elif { PYTHON_COMMAND=`which python` ; } ; then
   echo "PYTHON_COMMAND=${PYTHON_COMMAND}" > Makefile
else
   echo "PYTHON_COMMAND=/bin/false" > Makefile
   echo "ERROR: Required program 'python' could not be found. Please install python version 2.4 or higher, and then try again."
fi

# Now find ghostview. Use gv if it exists. If it doesn't, use ggv instead.

if { GV_COMMAND=`which gv` ; } ; then
   echo "GV_COMMAND=${GV_COMMAND}" >> Makefile
elif { FV_COMMAND=`which ggv` ; } ; then
   echo "GV_COMMAND=${GV_COMMAND}" >> Makefile
else
   echo "GV_COMMAND=/bin/false" >> Makefile
   echo "WARNING: Ghostview could not be found. Installation will proceed, but X11 terminal will not be available in PyXPlot. If required, install either ghostview (gv) or Gnome-ghostview (ggv), and then re-install PyXPlot."
fi

cat Makefile.skel >> Makefile
