#! /bin/sh

BINDIR=$1
DATADIR=$2
MANDIR=$3

cat <<End

-------------------------------------------------------------------------------
The pmw command has been installed in $BINDIR. The PostScript header
file, the music fonts, the MIDI translation files, the standard macros,
and the fontmetrics files have been installed in $DATADIR. The man
page has been installed in $MANDIR/man1.

Checking to see if you have GhostScript installed.
End

gs=`which gs`
if [ "$?" !=  0 ]; then
  gs=""
fi

gv=`which gv`
if [ "$?" != 0 ]; then
  gv=""
fi

if [ "$gs" = "" ]; then
  echo "You do not seem to have GhostScript installed."
else
  if [ "$gv" = "" ]; then
    echo "GhostScript appears to be installed as $gs."
    disp=gs
  else
    echo "GhostScript appears to be installed as $gs."
    echo "You also seem to have have the more flexible 'gv' viewer."
    disp=gv
  fi
  echo ""
  echo "You must make the PMW fonts available to GhostScript before you can view PMW"
  echo "output or convert it to a PDF. Setting the GS_FONTPATH environment variable"
  echo "is the simplest way to do this. For example, in a Bash-like shell:"
  echo ""
  echo "  export GS_FONTPATH=$DATADIR/psfonts:\$GS_FONTPATH"
  echo ""
  echo "This adds to any existing GS_FONTPATH setting. Then you can run (for example)"
  echo ""
  echo "  $disp somefile.ps"
  echo ""
  echo "where somefile.ps is the output from PMW. Please refer to the PMW manual for"
  echo "further information."
fi

echo "------------------------------------------------------------------------------"

# End
