hypre/mkdist
2000-10-11 22:14:56 +00:00

168 lines
5.1 KiB
Bash
Executable File

#!/bin/ksh
#BHEADER***********************************************************************
# (c) 2000 The Regents of the University of California
#
# See the file COPYRIGHT_and_DISCLAIMER for a complete copyright
# notice, contact person, and disclaimer.
#
# $Revision$
#EHEADER***********************************************************************
help ()
{
printf "$0: [-help] | [-display] | VersionId\n"
printf " where:\n"
printf " -help displays this message.\n"
printf " -display will report the cvs rtag history.\n"
printf " VersionId, is the desired version identification\n"
printf " (e.g., hypre-VersionId.tar.gz, hypre-1.2.0.tar.gz).\n"
printf " By convension, VersionId use the following syntax \"M.mm.rr\".\n"
printf " The \"M\" is the major release number, \"mm\" is the minor\n"
printf " relases number, and the \"rr\" an update number. VersionId\n"
printf " is used for the name of the release creation and is used\n"
printf " in the tar file name and root directory for the distribution.\n"
printf " If VersionId can be mapped into a valid rtag branch from the\n"
printf " source repository. It is assumed that the rtag id will follow\n"
printf " naming convension, \"VM-nn-rr\", note: the leading (capital)\n"
printf " \"V\" and the version number separated with \"-\" replacing\n"
printf " the \".\"s. If the VersionId can not be mapped to a current\n"
printf " rtag id, then an error message is generated.\n"
printf " The version information during the install will be derived\n"
printf " from the main trunk archive using the information in the\n"
printf " file utilites/HYPRE_utilites.h. Alpha, and Beta releases\n"
printf " are denoted by the following sytanx \"VM-nn-rr-a\" for alpha\n"
printf " releases, and \"VM-nn-rr-b\" for beta releases.\n"
}
usage ()
{
printf "usage: $0 VersionId\n"
}
display ()
{
printf "valid cvs rtags:\n"
cvs history -T -a | grep linear_solvers
}
#=============================================================================
# Define install permissions:
# - give everybody read/execute permission
# - give user/group write permission
#=============================================================================
OldMask=umask
umask 002
#=============================================================================
# Parse arguments
#=============================================================================
case $1 in
-h|-help)
help
exit;;
-d|-disp|-display)
display
exit;;
esac
if [ $# -gt 0 ]
then
VersionId=$1
RtagVersionId="`echo ${VersionId} | tr '.' '-'`"
RtagVersionId="V$RtagVersionId"
else
usage
exit
fi
#===========================================================================
# Update the source
#===========================================================================
# create dist directory
HYPRE_DIR="hypre-${VersionId}"
HYPRE_INSTALL_DIR=`pwd`"/$HYPRE_DIR"
export HYPRE_INSTALL_DIR
mkdir -p $HYPRE_INSTALL_DIR
mkdir $HYPRE_INSTALL_DIR/src
( # checkout the source from the repository
cd $HYPRE_INSTALL_DIR/src
if [ ! -d "$CVSROOT" ]
then
echo "Error: no CVS repository, CVSROOT = $CVSROOT"
exit
fi
cvs export -r ${RtagVersionId} linear_solvers
if [ $? -ne 0 ]
then
echo "Error: Rtag Version=${RtagVersionId} not found in CVS repository"
display
exit
fi
)
Version=`$HYPRE_INSTALL_DIR/src/linear_solvers/utilities/version -number`
if [ $? -ne 0 ]
then
echo "Error: CVS repository defective"
exit
fi
mv $HYPRE_DIR "hypre-${Version}"
HYPRE_DIR="hypre-${Version}"
HYPRE_INSTALL_DIR=`pwd`"/$HYPRE_DIR"
( # build documentation and tools and install
mkdir $HYPRE_INSTALL_DIR/bin
mkdir $HYPRE_INSTALL_DIR/docs
cd $HYPRE_INSTALL_DIR/src/linear_solvers
./configure
(cd docs; make -i install; make veryclean)
(cd tools; make install; make veryclean)
)
( # store version info
cd $HYPRE_INSTALL_DIR
cp src/linear_solvers/COPYRIGHT_and_DISCLAIMER .
cp src/linear_solvers/CHANGELOG .
)
# pop 'linear_solvers' directory to 'src'
mv $HYPRE_DIR/src/linear_solvers/* $HYPRE_DIR/src
rmdir $HYPRE_DIR/src/linear_solvers
# create the hypre-${VersionId}.tar file
echo "creating $HYPRE_DIR.tar file ..."
tar cf $HYPRE_DIR.tar \
$HYPRE_DIR/CHANGELOG \
$HYPRE_DIR/COPYRIGHT_and_DISCLAIMER \
$HYPRE_DIR/docs \
$HYPRE_DIR/bin \
$HYPRE_DIR/src/configure \
$HYPRE_DIR/src/tarch \
$HYPRE_DIR/src/Makefile.in \
$HYPRE_DIR/src/HYPRE.h \
$HYPRE_DIR/src/HYPRE_config.h.in \
$HYPRE_DIR/src/blas \
$HYPRE_DIR/src/utilities \
$HYPRE_DIR/src/struct_matrix_vector \
$HYPRE_DIR/src/struct_linear_solvers \
$HYPRE_DIR/src/sstruct_matrix_vector \
$HYPRE_DIR/src/sstruct_linear_solvers \
$HYPRE_DIR/src/seq_matrix_vector \
$HYPRE_DIR/src/parcsr_matrix_vector \
$HYPRE_DIR/src/distributed_matrix \
$HYPRE_DIR/src/matrix_matrix \
$HYPRE_DIR/src/IJ_matrix_vector \
$HYPRE_DIR/src/distributed_linear_solvers/pilut \
$HYPRE_DIR/src/distributed_linear_solvers/ParaSails \
$HYPRE_DIR/src/parcsr_linear_solvers \
$HYPRE_DIR/src/FEI_matrix_vector \
$HYPRE_DIR/src/test
gzip $HYPRE_DIR.tar