removed old libs
[TestXSLT.git] / libexpat / make-release.sh
1 #! /bin/bash
2 #
3 # make-release.sh: make an Expat release
4 #
5 # USAGE: make-release.sh tagname
6 #
7 # Note: tagname may be HEAD to just grab the head revision (e.g. for testing)
8 #
9
10 if test $# != 1; then
11   echo "USAGE: $0 tagname"
12   exit 1
13 fi
14
15 tmpdir=expat-release.$$
16 if test -e $tmpdir; then
17   echo "ERROR: oops. chose the $tmpdir subdir, but it exists."
18   exit 1
19 fi
20
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
23
24 echo ""
25 echo "----------------------------------------------------------------------"
26 echo "Preparing $tmpdir for release (running buildconf.sh)"
27 (cd $tmpdir && ./buildconf.sh) || exit 1
28
29 # figure out the release version
30 vsn="`$tmpdir/conftools/get-version.sh $tmpdir/lib/expat.h`"
31
32 echo ""
33 echo "Release version: $vsn"
34
35 if test "$1" = HEAD ; then
36   distdir=expat-`date '+%Y-%m-%d'`
37 else
38   distdir=expat-$vsn
39 fi
40 if test -e $distdir; then
41   echo "ERROR: for safety, you must manually remove $distdir."
42   rm -rf $tmpdir
43   exit 1
44 fi
45 mkdir $distdir || exit 1
46
47 CPOPTS=-Pp
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'
52 fi
53
54 echo ""
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
61 done
62
63 echo ""
64 echo "----------------------------------------------------------------------"
65 echo "Removing (temporary) checkout directory..."
66 rm -rf $tmpdir
67
68 tarball=$distdir.tar.gz
69 echo "Constructing $tarball..."
70 tar cf - $distdir | gzip -9 > $tarball || exit $?
71 rm -r $distdir
72
73 echo "Done."