1998-07-31 03:26:54 +08:00
|
|
|
#!/bin/sh
|
2005-10-22 23:35:28 +08:00
|
|
|
#
|
2007-02-15 06:25:02 +08:00
|
|
|
# Copyright by The HDF Group.
|
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
|
2017-04-18 03:32:16 +08:00
|
|
|
# the COPYING file, which can be found at the root of the source code
|
|
|
|
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
|
|
|
# If you do not have access to either file, you may request a copy from
|
|
|
|
# help@hdfgroup.org.
|
2005-10-22 23:35:28 +08:00
|
|
|
#
|
1998-01-30 00:31:24 +08:00
|
|
|
|
2009-01-07 06:58:54 +08:00
|
|
|
# Make a release of hdf5.
|
1998-01-30 00:31:24 +08:00
|
|
|
#
|
2009-01-07 06:58:54 +08:00
|
|
|
# Programmer: Robb Matzke
|
|
|
|
# Creation date: on or before 1998-01-29.
|
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.
|
2009-01-07 06:58:54 +08:00
|
|
|
#
|
|
|
|
# Albert Cheng, 2004-08-14
|
|
|
|
# Added the --private option.
|
|
|
|
#
|
|
|
|
# James Laird, 2005-09-07
|
|
|
|
# Added the md5 method.
|
1998-01-30 00:31:24 +08:00
|
|
|
|
2004-08-15 08:18:30 +08:00
|
|
|
# Function definitions
|
|
|
|
#
|
|
|
|
# Print Usage page
|
|
|
|
USAGE()
|
|
|
|
{
|
|
|
|
cat << EOF
|
2016-12-17 07:04:56 +08:00
|
|
|
Usage: $0 -d <dir> [--docver BRANCHNAME] [-h] [--nocheck] [--private] <methods> ...
|
2004-08-15 08:18:30 +08:00
|
|
|
-d DIR The name of the directory where the releas(es) should be
|
2014-04-30 09:24:57 +08:00
|
|
|
placed.
|
2016-12-17 07:04:56 +08:00
|
|
|
--docver BRANCHNAME This is added for 1.8 and beyond to get the correct
|
|
|
|
version of documentation files from the hdf5docs
|
|
|
|
repository. BRANCHNAME for v1.8 should be hdf5_1_8.
|
2014-12-17 18:44:35 +08:00
|
|
|
-h print the help page.
|
2004-08-15 08:18:30 +08:00
|
|
|
--nocheck Ignore errors in MANIFEST file.
|
|
|
|
--private Make a private release with today's date in version information.
|
|
|
|
|
2014-04-30 09:24:57 +08:00
|
|
|
This must be run at the top level of the source directory.
|
2004-08-15 08:18:30 +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
|
2015-04-01 01:40:43 +08:00
|
|
|
"tar" is assumed):
|
2004-08-15 08:18:30 +08:00
|
|
|
|
|
|
|
tar -- use tar and don't do any compressing.
|
|
|
|
gzip -- use gzip with "-9" and append ".gz" to the output name.
|
2017-02-22 05:18:17 +08:00
|
|
|
cmake-tgz -- create a tar file using the gzip default level with a build-unix.sh
|
|
|
|
command file and all other CMake files needed to build HDF5 source
|
|
|
|
using CMake on unix machines.
|
2004-08-15 08:18:30 +08:00
|
|
|
bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name.
|
2014-04-25 05:38:54 +08:00
|
|
|
zip -- convert all text files to DOS style and form a zip file for Windows use.
|
2017-02-22 05:18:17 +08:00
|
|
|
cmake-zip -- convert all text files to DOS style and create a zip file inluding cmake
|
|
|
|
scripts and .bat files to build HDF5 source using CMake on Windows.
|
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
|
|
|
|
2015-04-01 01:40:43 +08:00
|
|
|
An md5 checksum is produced for each archive created and stored in the md5 file.
|
|
|
|
|
2004-08-15 08:18:30 +08:00
|
|
|
Examples:
|
|
|
|
|
2014-04-30 09:24:57 +08:00
|
|
|
$ bin/release -d /tmp
|
|
|
|
/tmp/hdf5-1.8.13-RELEASE.txt
|
2015-04-01 01:40:43 +08:00
|
|
|
/tmp/hdf5-1.8.13.md5
|
2014-04-30 09:24:57 +08:00
|
|
|
/tmp/hdf5-1.8.13.tar
|
2004-08-15 08:18:30 +08:00
|
|
|
|
2014-04-30 09:24:57 +08:00
|
|
|
$ bin/release -d /tmp gzip
|
|
|
|
/tmp/hdf5-1.8.13-RELEASE.txt
|
2015-04-01 01:40:43 +08:00
|
|
|
/tmp/hdf5-1.8.13.md5
|
2014-04-30 09:24:57 +08:00
|
|
|
/tmp/hdf5-1.8.13.tar.gz
|
2004-08-15 08:18:30 +08:00
|
|
|
|
2015-04-01 01:40:43 +08:00
|
|
|
$ bin/release -d /tmp tar gzip zip
|
2014-04-30 09:24:57 +08:00
|
|
|
/tmp/hdf5-1.8.13-RELEASE.txt
|
2015-04-01 01:40:43 +08:00
|
|
|
/tmp/hdf5-1.8.13.md5
|
2014-04-30 09:24:57 +08:00
|
|
|
/tmp/hdf5-1.8.13.tar
|
|
|
|
/tmp/hdf5-1.8.13.tar.gz
|
|
|
|
/tmp/hdf5-1.8.13.tar.zip
|
2004-08-15 08:18:30 +08:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-04-25 05:38:54 +08:00
|
|
|
# Function name: tar2zip
|
|
|
|
# Convert the release tarball to a Windows zipball.
|
|
|
|
#
|
|
|
|
# Programmer: Albert Cheng
|
|
|
|
# Creation date: 2014-04-23
|
|
|
|
#
|
|
|
|
# Modifications
|
|
|
|
#
|
|
|
|
# Steps:
|
2017-02-22 05:18:17 +08:00
|
|
|
# 1. untar the tarball in a temporary directory;
|
2014-04-25 05:38:54 +08:00
|
|
|
# Note: do this in a temporary directory to avoid changing
|
2017-02-22 05:18:17 +08:00
|
|
|
# the original source directory which may be around.
|
2014-04-25 05:38:54 +08:00
|
|
|
# 2. convert all its text files to DOS (LF-CR) style;
|
|
|
|
# 3. form a zip file which is usable by Windows users.
|
|
|
|
#
|
|
|
|
# Parameters:
|
|
|
|
# $1 version
|
|
|
|
# $2 release tarball
|
|
|
|
# $3 output zipball file name
|
|
|
|
#
|
|
|
|
# Returns 0 if successful; 1 otherwise
|
|
|
|
#
|
|
|
|
tar2zip()
|
|
|
|
{
|
|
|
|
if [ $# -ne 3 ]; then
|
|
|
|
echo "usage: tar2zip <tarfilename> <zipfilename>"
|
|
|
|
return 1
|
|
|
|
fi
|
2017-02-22 05:18:17 +08:00
|
|
|
ztmpdir=/tmp/ztmpdir$$
|
2014-04-30 09:24:57 +08:00
|
|
|
mkdir -p $ztmpdir
|
2014-04-25 05:38:54 +08:00
|
|
|
version=$1
|
|
|
|
tarfile=$2
|
|
|
|
zipfile=$3
|
|
|
|
|
2014-04-30 09:24:57 +08:00
|
|
|
# step 1: untar tarball in ztmpdir
|
|
|
|
(cd $ztmpdir; tar xf -) < $tarfile
|
2014-04-25 05:38:54 +08:00
|
|
|
# sanity check
|
2014-04-30 09:24:57 +08:00
|
|
|
if [ ! -d $ztmpdir/$version ]; then
|
|
|
|
echo "untar did not create $ztmpdir/$version source dir"
|
2014-04-25 05:38:54 +08:00
|
|
|
# cleanup
|
2014-04-30 09:24:57 +08:00
|
|
|
rm -rf $ztmpdir
|
2014-04-25 05:38:54 +08:00
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
# step 2: convert text files
|
|
|
|
# There maybe a simpler way to do this.
|
|
|
|
# options used in unix2dos:
|
|
|
|
# -k Keep the date stamp
|
|
|
|
# -q quiet mode
|
|
|
|
# grep redirect output to /dev/null because -q or -s are not portable.
|
2014-04-30 09:24:57 +08:00
|
|
|
find $ztmpdir/$version | \
|
2014-04-25 05:38:54 +08:00
|
|
|
while read inf; do \
|
|
|
|
if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \
|
|
|
|
unix2dos -q -k $inf; \
|
|
|
|
fi\
|
|
|
|
done
|
|
|
|
# step 3: make zipball
|
|
|
|
# -9 maximum compression
|
|
|
|
# -y Store symbolic links as such in the zip archive
|
|
|
|
# -r recursive
|
|
|
|
# -q quiet
|
2014-04-30 09:24:57 +08:00
|
|
|
(cd $ztmpdir; zip -9 -y -r -q $version.zip $version)
|
|
|
|
mv $ztmpdir/$version.zip $zipfile
|
2014-04-25 05:38:54 +08:00
|
|
|
|
|
|
|
# cleanup
|
2014-04-30 09:24:57 +08:00
|
|
|
rm -rf $ztmpdir
|
2014-04-25 05:38:54 +08:00
|
|
|
}
|
|
|
|
|
2017-02-22 05:18:17 +08:00
|
|
|
# Function name: tar2cmakezip
|
|
|
|
# Convert the release tarball to a Windows zipball with files to run CMake build.
|
|
|
|
#
|
|
|
|
# Programmer: Larry Knox
|
|
|
|
# Creation date: 2017-02-20
|
|
|
|
#
|
|
|
|
# Modifications
|
|
|
|
#
|
|
|
|
# Steps:
|
|
|
|
# 1. untar the tarball in a temporary directory;
|
|
|
|
# Note: do this in a temporary directory to avoid changing
|
|
|
|
# the original source directory which may be around.
|
|
|
|
# 2. add build-unix.sh script.
|
|
|
|
# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory.
|
|
|
|
# 4. create gzipped tar file with these contents:
|
|
|
|
# build-unix.sh script
|
|
|
|
# hdf5-<version> source code directory extracted from tar file
|
|
|
|
# CTestScript.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
|
|
|
|
# HDF5config.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
|
|
|
|
# HDF5options.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
|
|
|
|
# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
|
|
|
|
# ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
|
|
|
|
|
|
|
|
|
|
|
|
# Parameters:
|
|
|
|
# $1 version
|
|
|
|
# $2 release tarball
|
|
|
|
# $3 output zipball file name
|
|
|
|
#
|
|
|
|
# Returns 0 if successful; 1 otherwise
|
|
|
|
#
|
|
|
|
# need function to create another temporary directory, extract the
|
|
|
|
# $tmpdir/$HDF5_VERS.tar into it, add (create) build-unix.sh,
|
|
|
|
# CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz and ZLib.tar.gz,
|
|
|
|
# and then tar.gz it.
|
|
|
|
tar2cmakezip()
|
|
|
|
{
|
|
|
|
if [ $# -ne 3 ]; then
|
|
|
|
echo "usage: tar2cmakezip <tarfilename> <tgzfilename>"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
cmziptmpdir=/tmp/cmziptmpdir$$
|
|
|
|
mkdir -p $cmziptmpdir
|
|
|
|
version=$1
|
|
|
|
tarfile=$2
|
|
|
|
zipfile=$3
|
|
|
|
|
|
|
|
# step 1: untar tarball in cmgztmpdir
|
|
|
|
(cd $cmziptmpdir; tar xf -) < $tarfile
|
|
|
|
# sanity check
|
|
|
|
if [ ! -d $cmziptmpdir/$version ]; then
|
|
|
|
echo "untar did not create $cmziptmpdir/$version source dir"
|
|
|
|
# cleanup
|
|
|
|
rm -rf $cmziptmpdir
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# step 2: add batch file for building CMake on window
|
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2013-32.bat $cmziptmpdir
|
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2013-64.bat $cmziptmpdir
|
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2015-32.bat $cmziptmpdir
|
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2015-64.bat $cmziptmpdir
|
2017-09-01 02:37:38 +08:00
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2017-32.bat $cmziptmpdir
|
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/build-VS2017-64.bat $cmziptmpdir
|
2017-02-22 05:18:17 +08:00
|
|
|
|
|
|
|
# step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files
|
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmziptmpdir
|
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmziptmpdir
|
|
|
|
cp $cmziptmpdir/$version/config/cmake/scripts/CTestScript.cmake $cmziptmpdir
|
|
|
|
cp $cmziptmpdir/$version/config/cmake/scripts/HDF5config.cmake $cmziptmpdir
|
|
|
|
cp $cmziptmpdir/$version/config/cmake/scripts/HDF5options.cmake $cmziptmpdir
|
|
|
|
|
|
|
|
# step 4: convert text files
|
|
|
|
# There maybe a simpler way to do this.
|
|
|
|
# options used in unix2dos:
|
|
|
|
# -k Keep the date stamp
|
|
|
|
# -q quiet mode
|
|
|
|
# grep redirect output to /dev/null because -q or -s are not portable.
|
|
|
|
find $cmziptmpdir/$version | \
|
|
|
|
while read inf; do \
|
|
|
|
if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \
|
|
|
|
unix2dos -q -k $inf; \
|
|
|
|
fi\
|
|
|
|
done
|
|
|
|
# step 3: make zipball
|
|
|
|
# -9 maximum compression
|
|
|
|
# -y Store symbolic links as such in the zip archive
|
|
|
|
# -r recursive
|
|
|
|
# -q quiet
|
|
|
|
(cd $cmziptmpdir; zip -9 -y -r -q CMake-$version.zip *)
|
|
|
|
mv $cmziptmpdir/CMake-$version.zip $zipfile
|
|
|
|
|
|
|
|
# cleanup
|
|
|
|
rm -rf $cmziptmpdir
|
|
|
|
}
|
|
|
|
|
|
|
|
# Function name: tar2cmaketgz
|
|
|
|
# Convert the release tarball to a Windows zipball with files to run CMake build.
|
|
|
|
#
|
|
|
|
# Programmer: Larry Knox
|
|
|
|
# Creation date: 2017-02-20
|
|
|
|
#
|
|
|
|
# Modifications
|
|
|
|
#
|
|
|
|
# Steps:
|
|
|
|
# 1. untar the tarball in a temporary directory;
|
|
|
|
# Note: do this in a temporary directory to avoid changing
|
|
|
|
# the original source directory which may be around.
|
|
|
|
# 2. add build-unix.sh script.
|
|
|
|
# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory.
|
|
|
|
# 4. create gzipped tar file with these contents:
|
|
|
|
# build-unix.sh script
|
|
|
|
# hdf5-<version> source code directory extracted from tar file
|
|
|
|
# CTestScript.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
|
|
|
|
# HDF5config.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
|
|
|
|
# HDF5options.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
|
|
|
|
# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
|
|
|
|
# ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
|
|
|
|
|
|
|
|
|
|
|
|
# Parameters:
|
|
|
|
# $1 version
|
|
|
|
# $2 release tarball
|
|
|
|
# $3 output zipball file name
|
|
|
|
#
|
|
|
|
# Returns 0 if successful; 1 otherwise
|
|
|
|
#
|
|
|
|
# need function to create another temporary directory, extract the
|
|
|
|
# $tmpdir/$HDF5_VERS.tar into it, add (create) build-unix.sh,
|
|
|
|
# CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz and ZLib.tar.gz,
|
|
|
|
# and then tar.gz it.
|
|
|
|
tar2cmaketgz()
|
|
|
|
{
|
|
|
|
if [ $# -ne 3 ]; then
|
|
|
|
echo "usage: tar2cmaketgz <tarfilename> <tgzfilename>"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
cmgztmpdir=/tmp/cmgztmpdir$$
|
|
|
|
mkdir -p $cmgztmpdir
|
|
|
|
version=$1
|
|
|
|
tarfile=$2
|
|
|
|
tgzfile=$3
|
|
|
|
|
|
|
|
# step 1: untar tarball in cmgztmpdir
|
|
|
|
(cd $cmgztmpdir; tar xf -) < $tarfile
|
|
|
|
# sanity check
|
|
|
|
if [ ! -d $cmgztmpdir/$version ]; then
|
|
|
|
echo "untar did not create $cmgztmpdir/$version source dir"
|
|
|
|
# cleanup
|
|
|
|
rm -rf $cmgztmpdir
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# step 2: add build-unix.sh script
|
|
|
|
(cd $cmgztmpdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -V -O hdf5.log" > build-unix.sh; chmod 755 build-unix.sh)
|
|
|
|
|
|
|
|
# step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files
|
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmgztmpdir
|
|
|
|
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpdir
|
|
|
|
cp $cmgztmpdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpdir
|
|
|
|
cp $cmgztmpdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpdir
|
|
|
|
cp $cmgztmpdir/$version/config/cmake/scripts/HDF5options.cmake $cmgztmpdir
|
|
|
|
tar czf $DEST/CMake-$HDF5_VERS.tar.gz -C $cmgztmpdir . || exit 1
|
|
|
|
|
|
|
|
# cleanup
|
|
|
|
rm -rf $cmgztmpdir
|
|
|
|
}
|
|
|
|
|
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.
|
2016-10-01 22:47:31 +08:00
|
|
|
if [ ! \( -f configure.ac -a -f bin/release \) ]; then
|
2006-02-07 11:49:32 +08:00
|
|
|
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
|
2011-06-16 06:58:13 +08:00
|
|
|
release_date=`date +%F`
|
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
|
2016-10-25 03:17:24 +08:00
|
|
|
DOC_URL=https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5doc.git
|
2006-02-16 04:37:00 +08:00
|
|
|
CPPLUS_RM_NAME=cpplus_RM
|
2016-12-24 03:54:05 +08:00
|
|
|
MAINT_MODE_ENABLED=""
|
|
|
|
|
|
|
|
# If maintainer mode is enabled in configure, it should be disabled for release,
|
|
|
|
# and enabled again after release files have been created. If already disabled
|
|
|
|
# there's no need to do either.
|
|
|
|
MAINT_MODE_ENABLED=`grep ^AM_MAINTAINER_MODE ./configure.ac | grep enable`
|
|
|
|
if [ "${MAINT_MODE_ENABLED}" != "" ]; then
|
|
|
|
bin/switch_maint_mode -disable ./configure.ac
|
|
|
|
fi
|
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
|
|
|
|
;;
|
2016-12-17 07:04:56 +08:00
|
|
|
--docver)
|
|
|
|
DOCVERSION=$1
|
|
|
|
shift
|
|
|
|
;;
|
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
|
|
|
|
|
2015-04-01 01:40:43 +08:00
|
|
|
# Default method is tar
|
1998-07-31 03:26:54 +08:00
|
|
|
if [ "X$methods" = "X" ]; then
|
2015-04-01 01:40:43 +08:00
|
|
|
methods="tar"
|
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
|
2017-02-22 05:18:17 +08:00
|
|
|
else
|
2004-08-15 08:18:30 +08:00
|
|
|
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
|
2017-09-26 22:37:43 +08:00
|
|
|
echo ""
|
|
|
|
echo "Note! If you are running bin/release in a development branch"
|
|
|
|
echo "later than v 1.8 the MANIFEST check is expected to fail when"
|
|
|
|
echo "autogen.sh has not been run successfully. Either run autogen.sh "
|
|
|
|
echo "with /usr/hdf/bin/AUTOTOOLS at the beginning of PATH or add the"
|
|
|
|
echo "--nocheck argument to the bin/release command."
|
1999-06-02 21:59:35 +08:00
|
|
|
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
|
2009-10-06 08:08:03 +08:00
|
|
|
# Save a backup copy of Makefile if exists.
|
|
|
|
test -f Makefile && mv Makefile $tmpdir/Makefile.x
|
1998-07-31 03:26:54 +08:00
|
|
|
cp -p Makefile.dist Makefile
|
2001-05-10 23:02:00 +08:00
|
|
|
|
2009-01-07 06:58:54 +08:00
|
|
|
# Update README.txt and release_docs/RELEASE.txt with release information in
|
|
|
|
# line 1.
|
2001-07-06 13:43:38 +08:00
|
|
|
for f in README.txt release_docs/RELEASE.txt; do
|
2011-06-16 06:58:13 +08:00
|
|
|
echo "HDF5 version $VERS released on $release_date" >$f.x
|
2009-01-07 06:58:54 +08:00
|
|
|
sed -e 1d $f >>$f.x
|
2001-07-06 13:43:38 +08:00
|
|
|
mv $f.x $f
|
|
|
|
# Make sure new files are of the right access mode
|
|
|
|
chmod 644 $f
|
|
|
|
done
|
|
|
|
|
2016-12-17 07:04:56 +08:00
|
|
|
# trunk is different than branches.
|
|
|
|
if [ "${DOCVERSION}" ]; then
|
|
|
|
DOC_URL="$DOC_URL -b ${DOCVERSION}"
|
|
|
|
fi
|
|
|
|
|
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
|
2015-04-01 01:40:43 +08:00
|
|
|
MD5file=$HDF5_VERS.md5
|
|
|
|
cp /dev/null $DEST/$MD5file
|
1998-07-31 03:26:54 +08:00
|
|
|
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
|
2015-04-01 01:40:43 +08:00
|
|
|
(cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file)
|
2006-01-05 01:38:30 +08:00
|
|
|
;;
|
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
|
2015-04-01 01:40:43 +08:00
|
|
|
(cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file)
|
2006-01-05 01:38:30 +08:00
|
|
|
;;
|
2017-02-22 05:18:17 +08:00
|
|
|
cmake-tgz)
|
|
|
|
test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2
|
|
|
|
tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2
|
|
|
|
(cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file)
|
|
|
|
;;
|
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
|
2015-04-01 01:40:43 +08:00
|
|
|
(cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file)
|
2006-01-05 01:38:30 +08:00
|
|
|
;;
|
2014-04-25 05:38:54 +08:00
|
|
|
zip)
|
|
|
|
test "$verbose" && echo " Creating zip ball..." 1>&2
|
|
|
|
tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2
|
2015-04-01 01:40:43 +08:00
|
|
|
(cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file)
|
2006-01-05 01:38:30 +08:00
|
|
|
;;
|
2017-02-22 05:18:17 +08:00
|
|
|
cmake-zip)
|
|
|
|
test "$verbose" && echo " Creating CMake-zip ball..." 1>&2
|
|
|
|
tar2cmakezip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.zip 1>&2
|
|
|
|
(cd $DEST; md5sum CMake-$HDF5_VERS.zip >> $MD5file)
|
|
|
|
;;
|
2006-02-16 04:37:00 +08:00
|
|
|
doc)
|
2016-12-17 07:04:56 +08:00
|
|
|
if [ "${DOCVERSION}" = "" ]; then
|
|
|
|
DOCVERSION=master
|
|
|
|
fi
|
2006-02-16 04:37:00 +08:00
|
|
|
test "$verbose" && echo " Creating docs..." 1>&2
|
2016-10-25 03:17:24 +08:00
|
|
|
# Check out docs from git repo
|
2016-12-17 07:04:56 +08:00
|
|
|
(cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} > /dev/null) || exit 1
|
2017-02-22 05:18:17 +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
|
2017-02-22 06:34:05 +08:00
|
|
|
rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1
|
|
|
|
mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1
|
2017-02-22 05:18:17 +08:00
|
|
|
# Compress the docs and move them to the release area
|
2017-02-22 06:34:05 +08:00
|
|
|
mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs || exit 1
|
|
|
|
(cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) || exit 1
|
|
|
|
mv $tmpdir/${HDF5_VERS}_docs.tar $DEST || exit 1
|
2006-02-16 04:37:00 +08:00
|
|
|
;;
|
2014-04-26 07:24:19 +08:00
|
|
|
*)
|
|
|
|
echo "***Error*** Unknown method $comp"
|
|
|
|
exit 1
|
|
|
|
;;
|
1998-07-31 03:26:54 +08:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2016-12-24 03:54:05 +08:00
|
|
|
# If AM_MAINTAINER_MODE was enabled before running this script
|
|
|
|
# restore it to "enabled".
|
|
|
|
if [ "${MAINT_MODE_ENABLED}" != "" ]; then
|
|
|
|
bin/switch_maint_mode -enable ./configure.ac
|
|
|
|
fi
|
|
|
|
|
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
|
|
|
|
2009-10-06 08:08:03 +08:00
|
|
|
# Remove distributed Makefile and restore previous Makefile if existed.
|
|
|
|
rm -f Makefile
|
2006-01-05 01:38:30 +08:00
|
|
|
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
|