httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stri...@apache.org
Subject cvs commit: httpd-dist/tools release.sh
Date Fri, 03 Jan 2003 09:32:17 GMT
striker     2003/01/03 01:32:17

  Added:       tools    release.sh
  Log:
  A new release script to make rolling releases easier.  Derived from
  apr-dist/tools/release.sh.
  
  Revision  Changes    Path
  1.1                  httpd-dist/tools/release.sh
  
  Index: release.sh
  ===================================================================
  #!/bin/sh
  #
  # release.sh : build a release tarball
  #
  # USAGE: release.sh PROJECT VERSION [SIGNING-USER]
  #
  #   The project is either 'httpd-1.3' or 'httpd-2.0'
  #
  #   The version number is specified as MAJOR.MINOR.PATCH (and will be used
  #   in the output tarball name). The script will then look for a CVS tag
  #   named "APACHE_{MAJOR}_{MINOR}_{PATCH}" and export it into a subdirectory
  #   (of the current directory). Next, it will run the appropriate commands
  #   to prepare and construct the tarball. The subdirectory will be cleaned
  #   up upon exit.
  #
  #   The "signing user" is the name of the key that you'll be signing the
  #   release with.
  #
  
  if test "$#" != 2 && test "$#" != 3; then
    echo "USAGE: $0 PROJECT VERSION [SIGNING-USER]" >&2
    echo "  see the comments in this script for more info." >&2
    exit 1
  fi
  
  case "$1" in
    httpd-1.3)
      repos_name="apache-1.3"
      tag_prefix="APACHE"
      ver_path="src/include/httpd.h"
      ver_define="SERVER_BASEREVISION"
      ;;
    httpd-2.0)
      repos_name="httpd-2.0"
      tag_prefix="APACHE"
      ver_path="include/ap_release.h"
      ver_define="AP_SERVER_PATCHLEVEL"
      apr_xxx_in_srclib=1
      ;;
    *)
      echo "ERROR: '$1' is an unknown project." >&2
      echo "  choose one of: httpd-1.3, httpd-2.0" >&2
      exit 1
  esac
  
  vsn="$2"
  major="`echo $vsn | sed 's/\..*$//'`"
  minor="`echo $vsn | sed 's/^[0-9]*\.\([0-9]*\)\..*$/\1/'`"
  patch="`echo $vsn | sed 's/^.*\.//'`"
  
  tagname="${tag_prefix}_${major}_${minor}_${patch}"
  
  dirname="`echo $repos_name | sed 's/-[0-9]*\.[0-9]*$//'`"
  dirname="${dirname}-$vsn"
  
  echo "  Version: $vsn"
  echo " Tag name: $tagname"
  echo "Directory: $dirname"
  
  if test -d ${dirname}; then
    echo "ERROR: for safety, you must manually remove $dirname." >&2
    exit 1
  fi
  
  split="---------------------------------------------------------------------"
  
  # make sure that the perms are good for the tarball
  umask 022
  
  echo $split
  echo ""
  echo "Starting CVS export of ${repos_name} to $dirname ..."
  echo ""
  
  cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic export -r ${tagname} -d ${dirname}
${repos_name} > /dev/null || exit 1
  
  if test $apr_xxx_in_srclib
  then
    cd $dirname/srclib
    cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic export -r ${tagname} apr > /dev/null
|| exit 1
    cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic export -r ${tagname} apr-util >
/dev/null || exit 1
    cd ../..
  fi
  
  echo $split
  echo ""
  
  if grep "#define.*${ver_define}.*-dev" ${dirname}/${ver_path} > /dev/null; then
    echo "ERROR: ${ver_path} still defines a development version." >&2
    echo "       This script can only produce formal releases." >&2
    exit 1
  fi
  
  echo "Copying CHANGES file"
  
  cp $dirname/CHANGES CHANGES_${major}_${minor}
  
  echo ""
  echo "Eliminating unwanted files (e.g. .cvsignore) and generating initial"
  echo "files via buildconf ..."
  echo ""
  
  find $dirname -name .cvsignore | xargs rm -f
  find $dirname -name autom4te*.cache | xargs rm -rf
  find $dirname -name STATUS | xargs rm -rf
  
  (cd ${dirname} && ./buildconf) || exit 1
  
  echo $split
  echo ""
  echo "Building the tarball, .gz, and .Z files ..."
  echo ""
  
  tar cf ${dirname}.tar ${dirname}
  gzip -9 --to-stdout ${dirname}.tar > ${dirname}.tar.gz
  compress ${dirname}.tar
  
  echo $split
  echo ""
  echo "Cleaning up and signing the files ..."
  echo ""
  
  rm -rf ${dirname}
  
  if test -x "`which md5sum 2> /dev/null`"; then
    md5sum ${dirname}.tar.gz > ${dirname}.tar.gz.md5
    md5sum ${dirname}.tar.Z > ${dirname}.tar.Z.md5
  fi
  
  if test -x "`which pgp 2> /dev/null`"; then
    if test -n "$3"; then
      user="-u $3"
    fi
  
    pgp -sba ${dirname}.tar.gz ${user}
    pgp -sba ${dirname}.tar.Z ${user}
  elif test -x "`which gpg 2> /dev/null`"; then
    if test -n "$3"; then
      user="--default-key $3"
    fi
  
    gpg --armor ${user} --detach-sign ${dirname}.tar.gz
    gpg --armor ${user} --detach-sign ${dirname}.tar.Z
  else
    echo "PGP or GnuPG not found!  Not signing release!"
  fi
  
  
  

Mime
View raw message