cd $instdir
gunzip __aldortmp__.tgz
tar xf __aldortmp__.tar
rm -f __aldortmp__.tar
echo Aldor installation completed.
echo

# Further setup

# -- link 

mkdir -p $instdir/aldor/$version
ln -s $instdir/aldor/$platform/$version $instdir/aldor/$version/$platform

# -- uniar
export LOC_UNIAR=`which ar`
echo "Aldor requires the 'ar' program to be accessible"
if ([ "X$LOC_UNIAR" != "X" ]) then \
   echo "The following location was found: $LOC_UNIAR"; \
   echo -n "If you want to use another location, please type it in now or press ENTER: ";\
   read newloc; \
   if ([ "X$newloc" != "X" ]) then export LOC_UNIAR=$newloc; fi; \
else \
   echo "No location was found for an 'ar' program"; \
   echo -n "Please provide the location of your installation of 'ar': "; \
   read newloc; \
   if ([ "X$newloc" != "X" ]) then export LOC_UNIAR=$newloc; \
   else echo "No location was provided, Aldor may not work properly in some cases.";\
   fi; \
fi

rm -f $instdir/aldor/$platform/$version/bin/uniar
if ([ "X$LOC_UNIAR" != "X" ]) then ln -s $LOC_UNIAR $instdir/aldor/$platform/$version/bin/uniar; fi 

echo "Please read the user manual or visit www.aldor.org"
exit 0
