BACKUP_NAME=oofem.tar.gz
DOC_RELEASE_FILES="elementlibmanual/elementlibmanual.ps paper-actap/paper-actap.ps extractorInput/extractorInput.ps matlibmanual/matlibmanual.ps oofemInput/oofemInput.ps poofemInput/poofemInput.ps usrman/usrman.ps"
DOC_DIRS="doc/elementlibmanual doc/paper-actap doc/extractorInput doc/matlibmanual doc/oofemInput doc/poofemInput doc/usrman"

if [ -z $1 ]
then
echo usage: do_release release_name
exit
fi

if [ -f "$1.tar.gz" ]
then
echo error: $1.tar.gz already exist
exit
fi

if [ -d "$1" ]
then
echo error: $1 dir already exist
exit
fi

echo =========================================
echo Building Release $1
echo =========================================
make backup
if [ ! -f $BACKUP_NAME ]
then
echo error: Backup file $BACKUP_NAME does not exist
exit
fi
mkdir $1
cd $1
tar xzvf ../$BACKUP_NAME
#
#
#

tar czvf $1.tar.gz $1
rm -fr $1
echo =========================================
echo Release $1.tar.gz created
echo =========================================

