#!/bin/sh
# usage: configure gappath
# this script creates `Makefile.conf' from `Makefile.conf.dist' 
GAPPATH=$1
if ! test -e $GAPPATH/sysinfo.gap; then
  echo "Please give correct GAP path as argument (and make sure that GAP"
  echo "is already properly installed)."
  echo "The path you gave is:"
  echo $GAPPATH
  exit
fi

if ! test -e ./bin/; then
  mkdir ./bin
fi

rm -f mfile sedfile
cat $GAPPATH/sysinfo.gap > mfile
echo "echo s/@GAPARCH@/\$GAParch/g > sedfile" >> mfile
echo "echo 's|@MPATH@|$PWD|g' >> sedfile" >> mfile
chmod +x mfile
./mfile
rm -f mfile
sed -f sedfile Makefile.conf.dist >Makefile.conf
rm -f sedfile

