###########################################
## Giacpy
###########################################


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

cd src


# It is very important that we have SAGE_LOCAL set, otherwise this
# might potentially delete stuff in /lib
# old giacpy spkg files <0.6 but no dir in case someone put a python version of giacpy.
echo "Deleting $SAGE_LOCAL/lib/python*/site-packages/giacpy-*"
rm -f "$SAGE_LOCAL"/lib/python*/site-packages/giacpy-*
echo "Deleting $SAGE_LOCAL/lib/python*/site-packages/giacpy.so"
rm -f "$SAGE_LOCAL"/lib/python*/site-packages/giacpy.so
# new giacpy spkg files >0.6
echo "Deleting $SAGE_LOCAL/lib/python*/site-packages/giacpy_sage*"
rm -f "$SAGE_LOCAL"/lib/python*/site-packages/giacpy_sage*


sdh_pip_install .

if [ $? -ne 0 ]; then
    exit 1
fi

