blob: fd8bbab92013561b481e285edc9e5b1b3121995b [file] [log] [blame]
Fred Drakefcf275e1998-03-03 17:22:44 +00001#! /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 Draked29cf371998-10-21 14:26:26 +00008# ./mktarball.sh [-t|--tools] release [tag]
9#
10# with -t|--tools: doesn't include the documents, only the framework
Fred Drakefcf275e1998-03-03 17:22:44 +000011#
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 Draked29cf371998-10-21 14:26:26 +000017# VERSION='$Revision$'
18
Fred Drake5772f331999-07-27 16:29:30 +000019GZIP='gzip -9'
20GZIPEXT=tgz
21
Fred Draked29cf371998-10-21 14:26:26 +000022if [ "$1" = "-t" -o "$1" = "--tools" ] ; then
23 shift 1
24 TOOLS_ONLY=true
25fi
Fred Drake8ea15f31999-07-23 16:09:11 +000026if [ "$1" = "-z" -o "$1" = "--zip" ] ; then
27 shift 1
28 USE_ZIP=true
29fi
Fred Drake5772f331999-07-27 16:29:30 +000030if [ "$1" = "-g" -o "$1" = "--targz" -o "$1" = "--tgz" ] ; then
Fred Drake8ea15f31999-07-23 16:09:11 +000031 shift 1
32 USE_ZIP=''
33fi
Fred Drake5772f331999-07-27 16:29:30 +000034if [ "$1" = "-b" -o "$1" = "--bz2" -o "$1" = "--bzip2" ] ; then
35 shift 1
36 GZIP='bzip2 -9'
37 GZIPEXT=tar.bz2
38fi
Fred Draked29cf371998-10-21 14:26:26 +000039
Fred Drakef2fa1e21998-05-11 18:52:24 +000040RELEASE=$1; shift
Fred Drakefcf275e1998-03-03 17:22:44 +000041
42TEMPDIR=tmp.$$
43MYDIR=`pwd`
44
45TAG="$1"
46
Fred Drakee3ae5191998-04-13 21:55:56 +000047mkdirhier $TEMPDIR/Python-$RELEASE/Doc || exit $?
Fred Drakefcf275e1998-03-03 17:22:44 +000048if [ "$TAG" ] ; then
Fred Drakee3ae5191998-04-13 21:55:56 +000049 cvs export -r $TAG -d $TEMPDIR/Python-$RELEASE/Doc python/dist/src/Doc \
Fred Drake2888bf61998-03-05 16:31:22 +000050 || exit $?
Fred Drakefcf275e1998-03-03 17:22:44 +000051else
Fred Drakee3ae5191998-04-13 21:55:56 +000052 cvs checkout -d $TEMPDIR/Python-$RELEASE/Doc python/dist/src/Doc || exit $?
Fred Drakefcf275e1998-03-03 17:22:44 +000053 rm -r `find $TEMPDIR -name CVS -print` || exit $?
54fi
55
Fred Drakef2fa1e21998-05-11 18:52:24 +000056rm -f `find $TEMPDIR -name .cvsignore -print`
Fred Drake45e564d1998-03-10 14:00:55 +000057
Fred Drakee3ae5191998-04-13 21:55:56 +000058rm -f $TEMPDIR/Python-$RELEASE/Doc/ref/ref.pdf
59rm -f $TEMPDIR/Python-$RELEASE/Doc/ref/ref.ps
Fred Drake45e564d1998-03-10 14:00:55 +000060
Fred Drakefcf275e1998-03-03 17:22:44 +000061
Fred Draked29cf371998-10-21 14:26:26 +000062if [ "$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 Drake8ea15f31999-07-23 16:09:11 +000067 if [ "$USE_ZIP" ] ; then
Fred Drake8ea15f31999-07-23 16:09:11 +000068 zip -r9 tools-$RELEASE.zip Doc || exit
69 else
Fred Drake5772f331999-07-27 16:29:30 +000070 (tar cf - Doc | $GZIP >$MYDIR/tools-$RELEASE.$GZIPEXT) || exit $?
Fred Drake8ea15f31999-07-23 16:09:11 +000071 fi
Fred Draked29cf371998-10-21 14:26:26 +000072else
73 cd $TEMPDIR
Fred Drake8ea15f31999-07-23 16:09:11 +000074 if [ "$USE_ZIP" ] ; then
75 zip -r9 $MYDIR/latex-$RELEASE.zip Python-$RELEASE || exit $?
76 else
Fred Drake5772f331999-07-27 16:29:30 +000077 (tar cf - Python-$RELEASE | $GZIP >$MYDIR/latex-$RELEASE.$GZIPEXT) \
Fred Drake8ea15f31999-07-23 16:09:11 +000078 || exit $?
79 fi
Fred Draked29cf371998-10-21 14:26:26 +000080fi
Fred Drakefcf275e1998-03-03 17:22:44 +000081cd $MYDIR
82rm -r $TEMPDIR || exit $?
83
84exit 0