#! /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 "If you run PMW to generate PDF output, you can view it with any PDF viewer."
  echo ""
  echo "If you run PMW to generate PostScript output, you must make the PMW fonts"
  echo "available to GhostScript before you can view it or convert it to a PDF."
  echo "Setting the GS_FONTPATH environment variable is the simplest way to do this."
  echo "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 PostScript output from PMW. Please refer to the PMW"
  echo "manual for further information."
fi

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

# End
