#!/bin/sh

set -e

source functions.sh

cd /home/rusconi/devel

thisDir=$(pwd)

##########################################################################
# Grab the version of the source package and construct the name of the 
# source tarball that we'll need.

cd massxpert || { echo "Failed to change directory to massxpert"; exit 1; }

VERSION=$(sourceVersion)

##########################################################################


# Go back to the parent directory
cd ${thisDir}

# At this point we are in /home/rusconi/devel.

mkdir massxpert-to-build-locally || echo "Failed to create massxpert-to-build-locally"

cp -rpf massxpert/* massxpert-to-build-locally/

cd massxpert-to-build-locally/

cmake -DCMAKE_INSTALL_PREFIX=/usr/anything .
make || echo "Failed to build the project"
make clean || echo "Failed to clean the project"

cd ..

diff -rqb massxpert massxpert-to-build-locally | egrep \("Only in massxpert-tobuild"\|"Files"\) > diff-massxpert-to-build-locally

cat diff-massxpert-to-build-locally

