#!/usr/bin/env bash

if [ "$SAGE_LOCAL" = "" ]; then
   echo "SAGE_LOCAL undefined ... exiting";
   echo "Maybe run 'sage -sh'?"
   exit 1
fi

# We need to delete the old path, so that there are no leftovers from the
# previous installation, otherwise mpmath could get broken (for example by
# importing some local files instead of the standard library ones...)
echo "Deleting $SAGE_LOCAL/lib/python/site-packages/mpmath*"
rm -rf "$SAGE_LOCAL"/lib/python/site-packages/mpmath*

cd src/

python setup.py install
