#!/bin/bash
# This is the script to install the sdet benchmark
#

. /etc/autobench.conf || . functions

. $AUTODIR/var/server-repository

wget -q -O $AUTODIR/sources/sdet-latest.tar.gz $SERVER_REPO/sources/sdet-latest.tar.gz
if [ $? -ne 0 ]; then 
  # Couldn't get the source -- complain
  echo "WARNING: could not download the source for sdet"
  exit 1
fi

# Uncompress it
pushd $AUTODIR/sources > /dev/null
rm -rf sdet 2> /dev/null

DST_DIR=`tar ztf sdet-latest.tar.gz | head -n 1`
tar zxf sdet-latest.tar.gz
ln -sf $DST_DIR sdet 

# build it...
popd > /dev/null
pushd $AUTODIR/sources/sdet > /dev/null
. ./shrc
make compile
if [ $? -ne 0 ]; then
  echo "ERROR: unable to make sdet compile"
  popd > /dev/null
  exit 1
fi
popd > /dev/null
