1998-07-31 03:26:54 +08:00
|
|
|
#!/bin/sh
|
2005-10-22 23:35:28 +08:00
|
|
|
#
|
|
|
|
# Copyright by the Board of Trustees of the University of Illinois.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This file is part of HDF5. The full HDF5 copyright notice, including
|
|
|
|
# terms governing use, modification, and redistribution, is contained in
|
|
|
|
# the files COPYING and Copyright.html. COPYING can be found at the root
|
|
|
|
# of the source code distribution tree; Copyright.html can be found at the
|
|
|
|
# root level of an installed copy of the electronic HDF5 document set and
|
|
|
|
# is linked from the top-level documents page. It can also be found at
|
|
|
|
# http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have
|
|
|
|
# access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
|
|
|
|
#
|
1998-01-30 00:31:24 +08:00
|
|
|
|
1998-07-31 03:26:54 +08:00
|
|
|
# Make a release of hdf5. The command-line switches are:
|
1998-01-30 00:31:24 +08:00
|
|
|
#
|
1998-07-31 03:26:54 +08:00
|
|
|
# -d DIR The name of the directory where the releas(es) should be
|
|
|
|
# placed. By default, the directory is ./releases
|
1999-06-02 21:59:35 +08:00
|
|
|
#
|
|
|
|
# --nocheck Ignore errors in MANIFEST file.
|
1998-07-31 03:26:54 +08:00
|
|
|
#
|
2007-02-14 22:51:02 +08:00
|
|
|
# --private Make a private release with today's date in version information.
|
|
|
|
#
|
1998-07-31 03:26:54 +08:00
|
|
|
# The other command-line options are the names of the programs to use
|
|
|
|
# for compressing the resulting tar archive (if none are given then
|
2005-09-08 04:20:37 +08:00
|
|
|
# `tar md5' is assumed):
|
1998-01-30 00:31:24 +08:00
|
|
|
#
|
1998-07-31 03:26:54 +08:00
|
|
|
# tar -- use tar and don't do any compressing.
|
|
|
|
# compress -- use compress and append `.Z' to the output name.
|
|
|
|
# gzip -- use gzip with `-9' and append `.gz' to the output name.
|
|
|
|
# bzip2 -- use bzip2 with `-9' and append `.bz2' to the output name.
|
2005-09-08 04:20:37 +08:00
|
|
|
# md5 -- produce a md5 checksum in addition to the archive.
|
2006-02-16 04:37:00 +08:00
|
|
|
# doc -- produce the latest doc tree in addition to the archive.
|
1998-01-30 00:31:24 +08:00
|
|
|
#
|
1998-07-31 03:26:54 +08:00
|
|
|
# Examples:
|
1998-01-30 00:31:24 +08:00
|
|
|
#
|
1998-07-31 03:26:54 +08:00
|
|
|
# $ release
|
|
|
|
# releases/hdf5-1.0.38.tar
|
2005-09-08 04:20:37 +08:00
|
|
|
# releases/hdf5-1.0.38.tar.md5
|
1998-02-11 00:39:47 +08:00
|
|
|
#
|
1998-07-31 03:26:54 +08:00
|
|
|
# $ release gzip
|
|
|
|
# releases/hdf5-1.0.38.tar.gz
|
|
|
|
#
|
2006-02-16 04:37:00 +08:00
|
|
|
# $ release -d /tmp tar compress gzip bzip2 md5 doc
|
1998-07-31 03:26:54 +08:00
|
|
|
# /tmp/hdf5-1.0.38.tar
|
|
|
|
# /tmp/hdf5-1.0.38.tar.Z
|
|
|
|
# /tmp/hdf5-1.0.38.tar.gz
|
|
|
|
# /tmp/hdf5-1.0.38.tar.bz2
|
2005-09-08 04:20:37 +08:00
|
|
|
# /tmp/hdf5-1.0.38.tar.md5
|
2006-02-16 04:37:00 +08:00
|
|
|
# /tmp/hdf5-1.0.38_doc.tar
|
1998-01-30 00:31:24 +08:00
|
|
|
#
|
1999-07-20 03:56:18 +08:00
|
|
|
# Modifications
|
|
|
|
# Robb Matzke, 1999-07-16
|
|
|
|
# The SunOS 5.6 sed *must* have slashes as delimiters. I changed things like
|
|
|
|
# `sed s+/CVS++' to `sed 's/\/CVS//'
|
1999-10-27 03:30:08 +08:00
|
|
|
#
|
|
|
|
# Albert Cheng, 1999-10-26
|
|
|
|
# Moved the MANIFEST checking to a separate command file so that
|
|
|
|
# it can be invoked individually.
|
1998-01-30 00:31:24 +08:00
|
|
|
|
2004-08-15 08:18:30 +08:00
|
|
|
# Function definitions
|
|
|
|
#
|
|
|
|
# Print Usage page
|
|
|
|
USAGE()
|
|
|
|
{
|
|
|
|
cat << EOF
|
|
|
|
Usage: $0 [--nocheck] [-d <dir>] [-h] <methods> ...
|
|
|
|
-d DIR The name of the directory where the releas(es) should be
|
|
|
|
placed. By default, the directory is ./releases
|
|
|
|
|
|
|
|
--nocheck Ignore errors in MANIFEST file.
|
|
|
|
|
|
|
|
--private Make a private release with today's date in version information.
|
|
|
|
|
|
|
|
The other command-line options are the names of the programs to use
|
|
|
|
for compressing the resulting tar archive (if none are given then
|
2005-09-08 04:20:37 +08:00
|
|
|
"tar md5" is assumed):
|
2004-08-15 08:18:30 +08:00
|
|
|
|
|
|
|
tar -- use tar and don't do any compressing.
|
|
|
|
compress -- use compress and append ".Z" to the output name.
|
|
|
|
gzip -- use gzip with "-9" and append ".gz" to the output name.
|
|
|
|
bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name.
|
2005-09-08 04:20:37 +08:00
|
|
|
md5 -- produce a md5 checksum in addition to the archive.
|
2006-02-16 04:37:00 +08:00
|
|
|
doc -- produce the latest doc tree in addition to the archive.
|
2004-08-15 08:18:30 +08:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ release
|
|
|
|
releases/hdf5-1.0.38.tar
|
2005-09-08 04:20:37 +08:00
|
|
|
releases/hdf5-1.0.38.tar.md5
|
2004-08-15 08:18:30 +08:00
|
|
|
|
|
|
|
$ release gzip
|
|
|
|
releases/hdf5-1.0.38.tar.gz
|
|
|
|
|
2005-09-08 04:20:37 +08:00
|
|
|
$ release -d /tmp tar compress gzip bzip2 md5
|
2004-08-15 08:18:30 +08:00
|
|
|
/tmp/hdf5-1.0.38.tar
|
|
|
|
/tmp/hdf5-1.0.38.tar.Z
|
|
|
|
/tmp/hdf5-1.0.38.tar.gz
|
|
|
|
/tmp/hdf5-1.0.38.tar.bz2
|
2005-09-08 04:20:37 +08:00
|
|
|
/tmp/hdf5-1.0.38.tar.md5
|
2004-08-15 08:18:30 +08:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2006-02-07 11:49:32 +08:00
|
|
|
# This command must be run at the top level of the hdf5 source directory.
|
|
|
|
# Verify this requirement.
|
|
|
|
if [ ! \( -f configure -a -f bin/release \) ]; then
|
|
|
|
echo "$0 must be run at the top level of the hdf5 source directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
1998-07-31 03:26:54 +08:00
|
|
|
# Defaults
|
|
|
|
DEST=releases
|
1999-01-07 19:37:42 +08:00
|
|
|
VERS=`perl bin/h5vers`
|
2004-08-15 08:18:30 +08:00
|
|
|
VERS_OLD=
|
1998-07-31 03:26:54 +08:00
|
|
|
test "$VERS" || exit 1
|
|
|
|
verbose=yes
|
1999-06-02 21:59:35 +08:00
|
|
|
check=yes
|
2004-08-15 08:18:30 +08:00
|
|
|
today=`date +%Y%m%d`
|
|
|
|
pmode='no'
|
2006-01-05 01:38:30 +08:00
|
|
|
tmpdir="../#release_tmp.$$" # tmp work directory
|
2007-01-25 15:22:34 +08:00
|
|
|
DOC_URL=http://svn.hdfgroup.uiuc.edu/hdf5doc/trunk
|
2006-02-16 04:37:00 +08:00
|
|
|
CPPLUS_RM_NAME=cpplus_RM
|
2004-08-15 08:18:30 +08:00
|
|
|
|
|
|
|
# Restore previous Version information
|
|
|
|
RESTORE_VERSION()
|
|
|
|
{
|
|
|
|
if [ X-${VERS_OLD} != X- ]; then
|
|
|
|
echo restoring version information back to $VERS_OLD
|
2006-02-02 06:26:14 +08:00
|
|
|
rm -f config/lt_vers.am
|
|
|
|
cp $tmpdir/lt_vers.am config/lt_vers.am
|
2006-02-16 04:30:51 +08:00
|
|
|
bin/h5vers -s $VERS_OLD
|
2004-08-15 08:18:30 +08:00
|
|
|
VERS_OLD=
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
1998-07-31 03:26:54 +08:00
|
|
|
|
|
|
|
# Command-line arguments
|
1999-06-02 21:59:35 +08:00
|
|
|
while [ -n "$1" ]; do
|
|
|
|
arg=$1
|
1998-07-31 03:26:54 +08:00
|
|
|
shift
|
1999-06-02 21:59:35 +08:00
|
|
|
case "$arg" in
|
|
|
|
-d)
|
|
|
|
DEST=$1
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--nocheck)
|
|
|
|
check=no
|
|
|
|
;;
|
2004-08-15 08:18:30 +08:00
|
|
|
-h)
|
|
|
|
USAGE
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
--private)
|
|
|
|
pmode=yes
|
|
|
|
;;
|
1999-06-02 21:59:35 +08:00
|
|
|
-*)
|
|
|
|
echo "Unknown switch: $arg" 1>&2
|
2004-08-15 08:18:30 +08:00
|
|
|
USAGE
|
1999-06-02 21:59:35 +08:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
methods="$methods $arg"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2005-09-08 04:20:37 +08:00
|
|
|
# Default methods are tar and md5
|
1998-07-31 03:26:54 +08:00
|
|
|
if [ "X$methods" = "X" ]; then
|
2005-09-08 04:20:37 +08:00
|
|
|
methods="tar md5"
|
1998-07-31 03:26:54 +08:00
|
|
|
fi
|
1999-06-02 21:59:35 +08:00
|
|
|
|
2006-01-05 01:38:30 +08:00
|
|
|
# Create the temporay work directory.
|
|
|
|
if mkdir $tmpdir; then
|
|
|
|
echo "temporary work directory for release. "\
|
2006-02-21 00:38:05 +08:00
|
|
|
"Can be deleted after release completes." > $tmpdir/README
|
2006-01-05 01:38:30 +08:00
|
|
|
else
|
|
|
|
echo "Failed to mkdir tmpdir($tmpdir)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2004-08-15 08:18:30 +08:00
|
|
|
# setup restoration in case of abort.
|
|
|
|
trap RESTORE_VERSION 0
|
|
|
|
|
|
|
|
if [ X$pmode = Xyes ]; then
|
|
|
|
VERS_OLD=$VERS
|
2006-02-02 06:26:14 +08:00
|
|
|
# Copy old version of config/lt_vers.am, since it's hard to
|
|
|
|
# "undo" changes to it.
|
|
|
|
cp config/lt_vers.am $tmpdir
|
2004-08-15 08:18:30 +08:00
|
|
|
# Set version information to m.n.r-of$today.
|
|
|
|
# (h5vers does not correctly handle just m.n.r-$today.)
|
|
|
|
VERS=`echo $VERS | sed -e s/-.*//`-of$today
|
|
|
|
echo Private release of $VERS
|
|
|
|
bin/h5vers -s $VERS
|
|
|
|
fi
|
1999-06-02 21:59:35 +08:00
|
|
|
|
2005-09-08 04:20:37 +08:00
|
|
|
# Store hdf5-$VERS ("hdf5-1.7.51", e.g.) to a variable to avoid typos
|
|
|
|
HDF5_VERS=hdf5-$VERS
|
|
|
|
|
|
|
|
test "$verbose" && echo "Releasing $HDF5_VERS to $DEST" 1>&2
|
1998-07-31 03:26:54 +08:00
|
|
|
if [ ! -d $DEST ]; then
|
|
|
|
echo " Destination directory $DEST does not exist" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
1999-10-27 03:30:08 +08:00
|
|
|
# Check the validity of the MANIFEST file.
|
|
|
|
bin/chkmanifest || fail=yes
|
1998-07-31 03:26:54 +08:00
|
|
|
if [ "X$fail" = "Xyes" ]; then
|
1999-06-02 21:59:35 +08:00
|
|
|
if [ $check = yes ]; then
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Continuing anyway..."
|
|
|
|
fi
|
1998-07-31 03:26:54 +08:00
|
|
|
fi
|
1998-09-08 21:38:29 +08:00
|
|
|
|
|
|
|
# Create a manifest that contains only files for distribution.
|
2006-01-05 01:38:30 +08:00
|
|
|
MANIFEST=$tmpdir/H5_MANIFEST
|
1998-09-08 21:38:29 +08:00
|
|
|
grep '^\.' MANIFEST | grep -v _DO_NOT_DISTRIBUTE_ >$MANIFEST
|
|
|
|
|
1998-07-31 03:26:54 +08:00
|
|
|
# Prepare the source tree for a release.
|
2006-01-05 01:38:30 +08:00
|
|
|
ln -s `pwd` $tmpdir/$HDF5_VERS || exit 1
|
|
|
|
mv Makefile $tmpdir/Makefile.x 2>/dev/null #might fail
|
1998-07-31 03:26:54 +08:00
|
|
|
cp -p Makefile.dist Makefile
|
2001-05-10 23:02:00 +08:00
|
|
|
|
2001-07-06 13:43:38 +08:00
|
|
|
# Update README.txt and release_docs/RELEASE.txt with release information.
|
|
|
|
for f in README.txt release_docs/RELEASE.txt; do
|
|
|
|
echo "HDF5 version $VERS released on `date`" >$f.x
|
|
|
|
tail +2l $f >>$f.x
|
|
|
|
mv $f.x $f
|
|
|
|
# Make sure new files are of the right access mode
|
|
|
|
chmod 644 $f
|
|
|
|
done
|
|
|
|
|
2001-05-10 23:02:00 +08:00
|
|
|
# Create the tar file
|
1998-07-31 03:26:54 +08:00
|
|
|
test "$verbose" && echo " Running tar..." 1>&2
|
1998-08-06 06:22:59 +08:00
|
|
|
( \
|
2006-01-05 01:38:30 +08:00
|
|
|
cd $tmpdir; \
|
2005-09-08 04:20:37 +08:00
|
|
|
tar cf $HDF5_VERS.tar $HDF5_VERS/Makefile \
|
1999-07-20 03:56:18 +08:00
|
|
|
`sed 's/^\.\//hdf5-'$VERS'\//' $MANIFEST` || exit 1 \
|
1998-08-06 06:22:59 +08:00
|
|
|
)
|
1998-07-31 03:26:54 +08:00
|
|
|
|
|
|
|
# Compress
|
|
|
|
for comp in $methods; do
|
|
|
|
case $comp in
|
|
|
|
tar)
|
2006-01-05 01:38:30 +08:00
|
|
|
cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar
|
|
|
|
;;
|
1998-07-31 03:26:54 +08:00
|
|
|
compress)
|
|
|
|
test "$verbose" && echo " Running compress..." 1>&2
|
2006-01-05 01:38:30 +08:00
|
|
|
compress -c <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.Z
|
|
|
|
;;
|
1998-07-31 03:26:54 +08:00
|
|
|
gzip)
|
|
|
|
test "$verbose" && echo " Running gzip..." 1>&2
|
2006-01-05 01:38:30 +08:00
|
|
|
gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz
|
|
|
|
;;
|
1998-07-31 03:26:54 +08:00
|
|
|
bzip2)
|
|
|
|
test "$verbose" && echo " Running bzip2..." 1>&2
|
2006-01-05 01:38:30 +08:00
|
|
|
bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2
|
|
|
|
;;
|
2005-09-08 04:20:37 +08:00
|
|
|
md5)
|
|
|
|
test "$verbose" && echo " Creating checksum..." 1>&2
|
2006-01-05 01:38:30 +08:00
|
|
|
(cd $tmpdir; md5sum $HDF5_VERS.tar ) > $DEST/$HDF5_VERS.tar.md5
|
|
|
|
;;
|
2006-02-16 04:37:00 +08:00
|
|
|
doc)
|
|
|
|
test "$verbose" && echo " Creating docs..." 1>&2
|
|
|
|
# Check out docs from svn repo
|
2007-01-25 15:22:34 +08:00
|
|
|
(cd $tmpdir; svn co $DOC_URL > /dev/null) || exit 1
|
2006-02-16 04:37:00 +08:00
|
|
|
# Create doxygen C++ RM
|
2007-01-25 15:22:34 +08:00
|
|
|
(cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1
|
2006-02-16 04:37:00 +08:00
|
|
|
# Replace version of C++ RM with just-created version
|
|
|
|
rm -rf $tmpdir/trunk/html/$CPPLUS_RM_NAME
|
|
|
|
mv c++/src/$CPPLUS_RM_NAME $tmpdir/trunk/html/$CPPLUS_RM_NAME
|
|
|
|
# Compress the docs and move them to the release area
|
|
|
|
mv $tmpdir/trunk $tmpdir/${HDF5_VERS}_docs
|
|
|
|
(cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs)
|
|
|
|
mv $tmpdir/${HDF5_VERS}_docs.tar $DEST
|
|
|
|
;;
|
1998-07-31 03:26:54 +08:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2001-07-06 13:43:38 +08:00
|
|
|
# Copy the RELEASE.txt to the release area.
|
2005-09-08 04:20:37 +08:00
|
|
|
cp release_docs/RELEASE.txt $DEST/$HDF5_VERS-RELEASE.txt
|
2001-05-10 23:02:00 +08:00
|
|
|
|
2006-01-05 01:38:30 +08:00
|
|
|
# Restore previous Makefile if existed.
|
|
|
|
test -f $tmpdir/Makefile.x && mv $tmpdir/Makefile.x Makefile
|
|
|
|
|
2004-08-15 08:18:30 +08:00
|
|
|
# Restore OLD version information, then no need for trap.
|
|
|
|
if [ X$pmode = Xyes ]; then
|
|
|
|
RESTORE_VERSION
|
|
|
|
trap 0
|
|
|
|
fi
|
|
|
|
|
2006-02-02 06:26:14 +08:00
|
|
|
# Remove temporary things
|
2006-02-16 04:30:51 +08:00
|
|
|
rm -rf $tmpdir
|
2006-02-02 06:26:14 +08:00
|
|
|
|
1998-07-31 03:26:54 +08:00
|
|
|
exit 0
|