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

cd src

# In the configure phase, the package fails to use rpath for a test
# program that it compiles, causing a build failure on Linux as
# reported in #22505 (libreadline.so not found).  We work around it by
# using LD_LIBRARY_PATH.
export LD_LIBRARY_PATH="$SAGE_LOCAL/lib":"$LD_LIBRARY_PATH"
perl Makefile.PL --prefix="$SAGE_LOCAL" INSTALL_BASE="$SAGE_LOCAL"
$MAKE install
