mirror of https://github.com/CGAL/cgal
96 lines
3.0 KiB
Bash
Executable File
96 lines
3.0 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Creating a new CGAL internal/public release.
|
|
#
|
|
# Radu Ursu, Sylvain Pion, 2004-2006.
|
|
|
|
# TODO :
|
|
# - The public release case should pass the info to create_internal_release.
|
|
# - Merge [some parts] into ./create_internal_release ?
|
|
# - There should be command line options to set public/internal,
|
|
# and the major/minor/bugfix/version_file release numbers.
|
|
|
|
# SVN working copy directory (TODO : pass it as command-line argument)
|
|
SOURCES_DIR=trunk
|
|
|
|
# Set the following to "y" in case of public release.
|
|
IS_PUBLIC_RELEASE="n"
|
|
|
|
# Set the major/minor/bugfix release numbers
|
|
MAJOR_NUMBER="3" # 2 digits max
|
|
MINOR_NUMBER="2" # 2 digits max
|
|
BUGFIX_NUMBER="0" # 1 digit max
|
|
|
|
# The internal release number is extracted/updated from this file :
|
|
VERSION_FILE="version_number"
|
|
|
|
# Where to put the resulting tarball and where to send the announce.
|
|
HTML_DIR="/u/bombyx/geometrica/CGAL/Members/Releases"
|
|
URL="http://cgal.inria.fr/CGAL/Members/Releases"
|
|
MAILTO="cgal-develop-l@postino.mpi-sb.mpg.de"
|
|
|
|
# SVN repository
|
|
SVNCGAL="svn+ssh://scm.gforge.inria.fr/svn/cgal"
|
|
|
|
LOGFILEBASE="create_release.log"
|
|
|
|
#TMPDIR="/tmp"
|
|
TMPDIR="${HOME}/CGAL/internal_release_making"
|
|
|
|
PATH=$PATH:/usr/local/bin
|
|
TAR=/usr/bin/gnu/tar
|
|
GZIP=/usr/bin/gnu/gzip
|
|
|
|
cd ${TMPDIR} || return
|
|
|
|
# The internal release number is considered only in non-public mode.
|
|
if [ $IS_PUBLIC_RELEASE = "n" ]; then
|
|
[ -r $VERSION_FILE ] || return
|
|
i=$(( `cat $VERSION_FILE` + 1 ))
|
|
rm -f $VERSION_FILE
|
|
printf "%d\n" "${i}" >> $VERSION_FILE
|
|
INTERNAL_STRING="-I-${i}"
|
|
internal_nr=`printf "%4s" "${i}" | sed "y/ /0/"`
|
|
else
|
|
INTERNAL_STRING=""
|
|
internal_nr="1000"
|
|
fi
|
|
|
|
# Do not show the bugfix number if it is 0.
|
|
if [ $BUGFIX_NUMBER != "0" ]; then
|
|
BUGFIX_STRING=".$BUGFIX_NUMBER"
|
|
else
|
|
BUGFIX_STRING=""
|
|
fi
|
|
release_name="CGAL-${MAJOR_NUMBER}.${MINOR_NUMBER}${BUGFIX_STRING}${INTERNAL_STRING}"
|
|
LOGFILE="`pwd`/${LOGFILEBASE}.${release_name}"
|
|
echo "${release_name}" >> ${LOGFILE} 2>&1
|
|
major_nr=`printf "%2s" "${MAJOR_NUMBER}" | sed "y/ /0/"`
|
|
minor_nr=`printf "%2s" "${MINOR_NUMBER}" | sed "y/ /0/"`
|
|
bugfix_nr=`printf "%1s" "${BUGFIX_NUMBER}" | sed "y/ /0/"`
|
|
release_number="1${major_nr}${minor_nr}${bugfix_nr}${internal_nr}"
|
|
echo "Release number is ${release_number}" >> ${LOGFILE} 2>&1
|
|
|
|
# Update the working copy
|
|
svn update ${SOURCES_DIR} >> ${LOGFILE} 2>&1
|
|
|
|
./create_internal_release -r ${release_name} -n ${release_number} -d ${TMPDIR} >> ${LOGFILE} 2>&1
|
|
cd ${TMPDIR}
|
|
# Make the release tarball
|
|
${TAR} -cf "${release_name}.tar" "${release_name}" >> ${LOGFILE} 2>&1
|
|
${GZIP} "${release_name}.tar" >> ${LOGFILE} 2>&1
|
|
rm -rf ${release_name} >> ${LOGFILE} 2>&1
|
|
mv "${release_name}.tar.gz" "${HTML_DIR}" >> ${LOGFILE} 2>&1
|
|
echo "${release_name}.tar.gz" > "${HTML_DIR}/LATEST"
|
|
mail -s "[automatic] ${release_name} is released" ${MAILTO} <<EOF
|
|
|
|
You can fetch it at :
|
|
${URL}/${release_name}.tar.gz
|
|
|
|
EOF
|
|
|
|
# Now we tag.
|
|
echo "Tagging ${SOURCES_DIR} with $release_name" >> ${LOGFILE} 2>&1
|
|
svn cp -m "Internal release tag for $release_name" ${SOURCES_DIR} $SVNCGAL/tags/internal-releases/$release_name >> ${LOGFILE} 2>&1
|
|
|