3 # make-release.sh: make an Expat release
5 # USAGE: make-release.sh tagname
7 # Note: tagname may be HEAD to just grab the head revision (e.g. for testing)
11 echo "USAGE: $0 tagname"
15 tmpdir=expat-release.$$
16 if test -e $tmpdir; then
17 echo "ERROR: oops. chose the $tmpdir subdir, but it exists."
21 echo "Checking out into temporary area: $tmpdir"
22 cvs -d :pserver:anonymous@cvs.libexpat.org:/cvsroot/expat export -r "$1" -d $tmpdir expat || exit 1
25 echo "----------------------------------------------------------------------"
26 echo "Preparing $tmpdir for release (running buildconf.sh)"
27 (cd $tmpdir && ./buildconf.sh) || exit 1
29 # figure out the release version
30 vsn="`$tmpdir/conftools/get-version.sh $tmpdir/lib/expat.h`"
33 echo "Release version: $vsn"
35 if test "$1" = HEAD ; then
36 distdir=expat-`date '+%Y-%m-%d'`
40 if test -e $distdir; then
41 echo "ERROR: for safety, you must manually remove $distdir."
45 mkdir $distdir || exit 1
48 if (cp --version 2>/dev/null | grep -q 'Free Software Foundation') ; then
49 # If we're using GNU cp, we can avoid the warnings about forward
50 # compatibility of the options.
51 CPOPTS='--parents --preserve'
55 echo "----------------------------------------------------------------------"
56 echo "Building $distdir based on the MANIFEST:"
57 files="`sed -e 's/[ ]:.*$//' $tmpdir/MANIFEST`"
58 for file in $files; do
59 echo "Copying $file..."
60 (cd $tmpdir && cp $CPOPTS $file ../$distdir) || exit 1
64 echo "----------------------------------------------------------------------"
65 echo "Removing (temporary) checkout directory..."
68 tarball=$distdir.tar.gz
69 echo "Constructing $tarball..."
70 tar cf - $distdir | gzip -9 > $tarball || exit $?