#!/bin/sh # $Id: plt-cvs-build,v 1.9 2002/03/26 16:48:38 nwv Exp $ UTC # $Source: /home/nwv/cvsroot/scripts/plt-cvs-build,v $ # Created: 18-Feb-2002 by Neil W. Van Dyke # http://www.cs.utah.edu/plt/anoncvs/ PltDir="/home/nwv/plt" CvsDir="${PltDir}/from-cvs" SrcDir="${CvsDir}/src" Msg() { echo "PLT-CVS-BUILD: ${1}" } Warning() { Msg "*WARNING* ${1}" } Error() { Msg "*ERROR* ${1}" } FatalError() { Error "$1" exit 1 } RestoreDoc() { cd "$PltDir" if [ -d doc ] ; then if [ -d collects ] ; then [ -d collects/doc ] && Warning "both doc and collects/doc exist!" Msg "Restoring doc collection..." mv doc collects/. || Warning "could not restore doc collection." else Warning "Saved doc collection, but no collects directory." fi else Msg "No doc collection to restore." fi } cd "$SrcDir" Msg "make clean..." make clean Msg "configure..." ./configure --prefix="$PltDir" || FatalError "configure failed." #./configure --prefix="$PltDir" --enable-sgc || FatalError "configure failed." Msg "make..." make || FatalError "make failed." cd "$PltDir" if [ -d "collects" ] ; then if [ -d "collects/doc" ] ; then Msg "Saving doc collection..." [ -d doc ] && Error "saved doc collection already exists" mv collects/doc doc else Msg "No docs collection to save." [ -d doc ] && Warning "saved doc collection already exists" fi Msg "Removing existing collections directory..." rm -rf collects else Msg "No existing collections directory." fi cd "$SrcDir" Msg "make install..." yes n | make install if [ $? != 0 ] ; then Error "make install failed." cd "$PltDir" RestoreDoc exit 1 fi Msg "setup-plt..." "${PltDir}/bin/setup-plt" || Warning "setup-plt failed." RestoreDoc Msg "Done." exit 0 #EOF