blob: 9ec622b8d17010fa54d7f700d1feb021f595c280 [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
19if [ "$1" = "-t" -o "$1" = "--tools" ] ; then
20 shift 1
21 TOOLS_ONLY=true
22fi
Fred Drake8ea15f31999-07-23 16:09:11 +000023if [ "$1" = "-z" -o "$1" = "--zip" ] ; then
24 shift 1
25 USE_ZIP=true
26fi
27if [ "$1" = "-g" -o "$1" = "--targz" ] ; then
28 shift 1
29 USE_ZIP=''
30fi
Fred Draked29cf371998-10-21 14:26:26 +000031
Fred Drakef2fa1e21998-05-11 18:52:24 +000032RELEASE=$1; shift
Fred Drakefcf275e1998-03-03 17:22:44 +000033
34TEMPDIR=tmp.$$
35MYDIR=`pwd`
36
37TAG="$1"
38
Fred Drakee3ae5191998-04-13 21:55:56 +000039mkdirhier $TEMPDIR/Python-$RELEASE/Doc || exit $?
Fred Drakefcf275e1998-03-03 17:22:44 +000040if [ "$TAG" ] ; then
Fred Drakee3ae5191998-04-13 21:55:56 +000041 cvs export -r $TAG -d $TEMPDIR/Python-$RELEASE/Doc python/dist/src/Doc \
Fred Drake2888bf61998-03-05 16:31:22 +000042 || exit $?
Fred Drakefcf275e1998-03-03 17:22:44 +000043else
Fred Drakee3ae5191998-04-13 21:55:56 +000044 cvs checkout -d $TEMPDIR/Python-$RELEASE/Doc python/dist/src/Doc || exit $?
Fred Drakefcf275e1998-03-03 17:22:44 +000045 rm -r `find $TEMPDIR -name CVS -print` || exit $?
46fi
47
Fred Drakef2fa1e21998-05-11 18:52:24 +000048rm -f `find $TEMPDIR -name .cvsignore -print`
Fred Drake45e564d1998-03-10 14:00:55 +000049
Fred Drakee3ae5191998-04-13 21:55:56 +000050rm -f $TEMPDIR/Python-$RELEASE/Doc/ref/ref.pdf
51rm -f $TEMPDIR/Python-$RELEASE/Doc/ref/ref.ps
Fred Drake45e564d1998-03-10 14:00:55 +000052
Fred Drakefcf275e1998-03-03 17:22:44 +000053
Fred Draked29cf371998-10-21 14:26:26 +000054if [ "$TOOLS_ONLY" ] ; then
55 cd $TEMPDIR/Python-$RELEASE/Doc
56 # remove the actual documents
57 rm -rf api ext lib mac ref tut
58 cd ..
Fred Drake8ea15f31999-07-23 16:09:11 +000059 if [ "$USE_ZIP" ] ; then
60 pwd
61 zip -r9 tools-$RELEASE.zip Doc || exit
62 else
63 (tar cf - Doc | gzip -9 >$MYDIR/tools-$RELEASE.tgz) || exit $?
64 fi
Fred Draked29cf371998-10-21 14:26:26 +000065else
66 cd $TEMPDIR
Fred Drake8ea15f31999-07-23 16:09:11 +000067 if [ "$USE_ZIP" ] ; then
68 zip -r9 $MYDIR/latex-$RELEASE.zip Python-$RELEASE || exit $?
69 else
70 (tar cf - Python-$RELEASE | gzip -9 >$MYDIR/latex-$RELEASE.tgz) \
71 || exit $?
72 fi
Fred Draked29cf371998-10-21 14:26:26 +000073fi
Fred Drakefcf275e1998-03-03 17:22:44 +000074cd $MYDIR
75rm -r $TEMPDIR || exit $?
76
77exit 0