INFODIR= info
TOOLSDIR= tools
-# This is the *documentation* release, and is used to construct the file
-# names of the downloadable tarballs.
-RELEASE=2.3.3c1
+# This is the *documentation* release, and is used to construct the
+# file names of the downloadable tarballs. It is initialized by the
+# getversioninfo script to ensure that the right version number is
+# used; the script will also write commontex/patchlevel.tex if that
+# doesn't exist or needs to be changed. Documents which depend on the
+# version number should use \input{patchlevel} and include
+# commontex/patchlevel.tex in their dependencies.
+RELEASE=$(shell $(PYTHON) tools/getversioninfo)
PYTHON= python
DVIPS= dvips -N0 -t $(PAPER)
COMMONTEX=commontex/copyright.tex \
commontex/license.tex \
+ commontex/patchlevel.tex \
commontex/boilerplate.tex
MANSTYLES= texinputs/fncychap.sty \
commontex/typestruct.h \
commontex/reportingbugs.tex
-TUTFILES= tut/tut.tex $(MANSTYLES) $(COMMONTEX)
+TUTFILES= tut/tut.tex tut/glossary.tex $(MANSTYLES) $(COMMONTEX)
# LaTeX source files for the Python Reference Manual
REFFILES= $(MANSTYLES) $(INDEXSTYLES) $(COMMONTEX) \
import cvsinfo
+try:
+ __file__
+except NameError:
+ __file__ = sys.argv[0]
+
+tools = os.path.dirname(os.path.abspath(__file__))
+Doc = os.path.dirname(tools)
+patchlevel_tex = os.path.join(Doc, "commontex", "patchlevel.tex")
quiet = 0
rx = re.compile(r":ext:(?:[a-zA-Z0-9]+@)?cvs\.([a-zA-Z0-9]+).sourceforge.net:"
# remove CVS directories
for p in ('*/CVS', '*/*/CVS', '*/*/*/CVS'):
map(shutil.rmtree, glob.glob(p))
- for f in ('.cvsignore', '*/.cvsignore'):
- map(os.unlink, glob.glob(f))
+ for f in ('.cvsignore', '*/.cvsignore'):
+ map(os.unlink, glob.glob(f))
+
+ # Copy in the version informtation, if we're not just going to
+ # rip it back out:
+ if not tools:
+ if not os.path.exists(patchlevel_tex):
+ run(os.path.join(here, "getversioninfo"))
+ dest = os.path.join("Python-Docs-" + release, "commontex",
+ "patchlevel.tex")
+ shutil.copyfile(patchlevel_tex, dest)
+
+ # Copy in the license file:
LICENSE = os.path.normpath(
os.path.join(mydir, os.pardir, os.pardir, "LICENSE"))
shutil.copyfile(LICENSE, "LICENSE")
archive = "doctools-" + release
# we don't want the actual documents in this case:
for d in ("api", "dist", "doc", "ext", "inst",
- "lib", "mac", "ref", "tut"):
+ "lib", "mac", "ref", "tut", "commontex"):
shutil.rmtree(os.path.join(pkgdir, d))
else:
archive = "latex-" + release