Fred Drake | fcf275e | 1998-03-03 17:22:44 +0000 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | # |
| 3 | # script to create the latex source distribution |
| 4 | # * should be modified to get the Python version number automatically |
| 5 | # from the Makefile or someplace. |
| 6 | # |
| 7 | # usage: |
Fred Drake | d29cf37 | 1998-10-21 14:26:26 +0000 | [diff] [blame] | 8 | # ./mktarball.sh [-t|--tools] release [tag] |
| 9 | # |
| 10 | # with -t|--tools: doesn't include the documents, only the framework |
Fred Drake | fcf275e | 1998-03-03 17:22:44 +0000 | [diff] [blame] | 11 | # |
| 12 | # without [tag]: generate from the current version that's checked in |
| 13 | # (*NOT* what's in the current directory!) |
| 14 | # |
| 15 | # with [tag]: generate from the named tag |
| 16 | |
Fred Drake | d29cf37 | 1998-10-21 14:26:26 +0000 | [diff] [blame] | 17 | # VERSION='$Revision$' |
| 18 | |
Fred Drake | 5772f33 | 1999-07-27 16:29:30 +0000 | [diff] [blame] | 19 | GZIP='gzip -9' |
| 20 | GZIPEXT=tgz |
| 21 | |
Fred Drake | d29cf37 | 1998-10-21 14:26:26 +0000 | [diff] [blame] | 22 | if [ "$1" = "-t" -o "$1" = "--tools" ] ; then |
| 23 | shift 1 |
| 24 | TOOLS_ONLY=true |
| 25 | fi |
Fred Drake | 8ea15f3 | 1999-07-23 16:09:11 +0000 | [diff] [blame] | 26 | if [ "$1" = "-z" -o "$1" = "--zip" ] ; then |
| 27 | shift 1 |
| 28 | USE_ZIP=true |
| 29 | fi |
Fred Drake | 5772f33 | 1999-07-27 16:29:30 +0000 | [diff] [blame] | 30 | if [ "$1" = "-g" -o "$1" = "--targz" -o "$1" = "--tgz" ] ; then |
Fred Drake | 8ea15f3 | 1999-07-23 16:09:11 +0000 | [diff] [blame] | 31 | shift 1 |
| 32 | USE_ZIP='' |
| 33 | fi |
Fred Drake | 5772f33 | 1999-07-27 16:29:30 +0000 | [diff] [blame] | 34 | if [ "$1" = "-b" -o "$1" = "--bz2" -o "$1" = "--bzip2" ] ; then |
| 35 | shift 1 |
| 36 | GZIP='bzip2 -9' |
| 37 | GZIPEXT=tar.bz2 |
| 38 | fi |
Fred Drake | d29cf37 | 1998-10-21 14:26:26 +0000 | [diff] [blame] | 39 | |
Fred Drake | f2fa1e2 | 1998-05-11 18:52:24 +0000 | [diff] [blame] | 40 | RELEASE=$1; shift |
Fred Drake | fcf275e | 1998-03-03 17:22:44 +0000 | [diff] [blame] | 41 | |
| 42 | TEMPDIR=tmp.$$ |
| 43 | MYDIR=`pwd` |
| 44 | |
| 45 | TAG="$1" |
| 46 | |
Fred Drake | e3ae519 | 1998-04-13 21:55:56 +0000 | [diff] [blame] | 47 | mkdirhier $TEMPDIR/Python-$RELEASE/Doc || exit $? |
Fred Drake | fcf275e | 1998-03-03 17:22:44 +0000 | [diff] [blame] | 48 | if [ "$TAG" ] ; then |
Fred Drake | e3ae519 | 1998-04-13 21:55:56 +0000 | [diff] [blame] | 49 | cvs export -r $TAG -d $TEMPDIR/Python-$RELEASE/Doc python/dist/src/Doc \ |
Fred Drake | 2888bf6 | 1998-03-05 16:31:22 +0000 | [diff] [blame] | 50 | || exit $? |
Fred Drake | fcf275e | 1998-03-03 17:22:44 +0000 | [diff] [blame] | 51 | else |
Fred Drake | e3ae519 | 1998-04-13 21:55:56 +0000 | [diff] [blame] | 52 | cvs checkout -d $TEMPDIR/Python-$RELEASE/Doc python/dist/src/Doc || exit $? |
Fred Drake | fcf275e | 1998-03-03 17:22:44 +0000 | [diff] [blame] | 53 | rm -r `find $TEMPDIR -name CVS -print` || exit $? |
| 54 | fi |
| 55 | |
Fred Drake | f2fa1e2 | 1998-05-11 18:52:24 +0000 | [diff] [blame] | 56 | rm -f `find $TEMPDIR -name .cvsignore -print` |
Fred Drake | 45e564d | 1998-03-10 14:00:55 +0000 | [diff] [blame] | 57 | |
Fred Drake | e3ae519 | 1998-04-13 21:55:56 +0000 | [diff] [blame] | 58 | rm -f $TEMPDIR/Python-$RELEASE/Doc/ref/ref.pdf |
| 59 | rm -f $TEMPDIR/Python-$RELEASE/Doc/ref/ref.ps |
Fred Drake | 45e564d | 1998-03-10 14:00:55 +0000 | [diff] [blame] | 60 | |
Fred Drake | fcf275e | 1998-03-03 17:22:44 +0000 | [diff] [blame] | 61 | |
Fred Drake | d29cf37 | 1998-10-21 14:26:26 +0000 | [diff] [blame] | 62 | if [ "$TOOLS_ONLY" ] ; then |
| 63 | cd $TEMPDIR/Python-$RELEASE/Doc |
| 64 | # remove the actual documents |
| 65 | rm -rf api ext lib mac ref tut |
| 66 | cd .. |
Fred Drake | 8ea15f3 | 1999-07-23 16:09:11 +0000 | [diff] [blame] | 67 | if [ "$USE_ZIP" ] ; then |
Fred Drake | 8ea15f3 | 1999-07-23 16:09:11 +0000 | [diff] [blame] | 68 | zip -r9 tools-$RELEASE.zip Doc || exit |
| 69 | else |
Fred Drake | 5772f33 | 1999-07-27 16:29:30 +0000 | [diff] [blame] | 70 | (tar cf - Doc | $GZIP >$MYDIR/tools-$RELEASE.$GZIPEXT) || exit $? |
Fred Drake | 8ea15f3 | 1999-07-23 16:09:11 +0000 | [diff] [blame] | 71 | fi |
Fred Drake | d29cf37 | 1998-10-21 14:26:26 +0000 | [diff] [blame] | 72 | else |
| 73 | cd $TEMPDIR |
Fred Drake | 8ea15f3 | 1999-07-23 16:09:11 +0000 | [diff] [blame] | 74 | if [ "$USE_ZIP" ] ; then |
| 75 | zip -r9 $MYDIR/latex-$RELEASE.zip Python-$RELEASE || exit $? |
| 76 | else |
Fred Drake | 5772f33 | 1999-07-27 16:29:30 +0000 | [diff] [blame] | 77 | (tar cf - Python-$RELEASE | $GZIP >$MYDIR/latex-$RELEASE.$GZIPEXT) \ |
Fred Drake | 8ea15f3 | 1999-07-23 16:09:11 +0000 | [diff] [blame] | 78 | || exit $? |
| 79 | fi |
Fred Drake | d29cf37 | 1998-10-21 14:26:26 +0000 | [diff] [blame] | 80 | fi |
Fred Drake | fcf275e | 1998-03-03 17:22:44 +0000 | [diff] [blame] | 81 | cd $MYDIR |
| 82 | rm -r $TEMPDIR || exit $? |
| 83 | |
| 84 | exit 0 |