#!/bin/sh

test -z "$MAPLELIB" && MAPLELIB="$HOME/lib/maplelib"
mkdirhier "$MAPLELIB" 
if test -e "$MAPLELIB/maple.lib"; then
  echo "Attempting to install to $MAPLELIB"
else
  echo "Creating a new Maple library in $MAPLELIB"
  echo "march('create',\"$MAPLELIB\",1);" | maple
fi
maple -b "$MAPLELIB" -B  < main.mpl
