[PATCH 0 of 7] Build documentation using distutils - v4

Dan Villiom Podlaski Christiansen danchr at gmail.com
Tue Dec 1 20:33:10 UTC 2009


Hi,

This is yet another round of my build system hackery series. They've
been adapted to feedback from Martin Geisler as well as Gilles
Moris.

Both kinds of build appear to work well now. Please note that I still
can't test the RPM building process, but I hope it works :)

The first patch renames two directories; this may break individual
patch queues. If so, a line of sed'ing or two will easily fix it!

2009-12-01  Dan Villiom Podlaski Christiansen  <danchr at gmail.com>

	* help/config.txt, help/dates.txt, help/diffs.txt,
	help/environment.txt, help/extensions.txt, help/multirevs.txt,
	help/patterns.txt, help/revisions.txt, help/templates.txt,
	help/urls.txt, mercurial/help/config.txt, mercurial/help/dates.txt,
	mercurial/help/diffs.txt, mercurial/help/environment.txt,
	mercurial/help/extensions.txt, mercurial/help/multirevs.txt,
	mercurial/help/patterns.txt, mercurial/help/revisions.txt,
	mercurial/help/templates.txt, mercurial/help/urls.txt,
	mercurial/templates/atom/changelog.tmpl,
	mercurial/templates/atom/changelogentry.tmpl,
	mercurial/templates/atom/error.tmpl,
	mercurial/templates/atom/filelog.tmpl,
	mercurial/templates/atom/header.tmpl, mercurial/templates/atom/map,
	mercurial/templates/atom/tagentry.tmpl,
	mercurial/templates/atom/tags.tmpl,
	mercurial/templates/coal/header.tmpl, mercurial/templates/coal/map,
	mercurial/templates/gitweb/branches.tmpl,
	mercurial/templates/gitweb/changelog.tmpl,
	mercurial/templates/gitweb/changelogentry.tmpl,
	mercurial/templates/gitweb/changeset.tmpl,
	mercurial/templates/gitweb/error.tmpl,
	mercurial/templates/gitweb/fileannotate.tmpl,
	mercurial/templates/gitweb/filediff.tmpl,
	mercurial/templates/gitweb/filelog.tmpl,
	mercurial/templates/gitweb/filerevision.tmpl,
	mercurial/templates/gitweb/footer.tmpl,
	mercurial/templates/gitweb/graph.tmpl,
	mercurial/templates/gitweb/header.tmpl,
	mercurial/templates/gitweb/index.tmpl,
	mercurial/templates/gitweb/manifest.tmpl,
	mercurial/templates/gitweb/map,
	mercurial/templates/gitweb/notfound.tmpl,
	mercurial/templates/gitweb/search.tmpl,
	mercurial/templates/gitweb/shortlog.tmpl,
	mercurial/templates/gitweb/summary.tmpl,
	mercurial/templates/gitweb/tags.tmpl, mercurial/templates/map-
	cmdline.changelog, mercurial/templates/map-cmdline.compact,
	mercurial/templates/map-cmdline.default,
	mercurial/templates/monoblue/branches.tmpl,
	mercurial/templates/monoblue/changelog.tmpl,
	mercurial/templates/monoblue/changelogentry.tmpl,
	mercurial/templates/monoblue/changeset.tmpl,
	mercurial/templates/monoblue/error.tmpl,
	mercurial/templates/monoblue/fileannotate.tmpl,
	mercurial/templates/monoblue/filediff.tmpl,
	mercurial/templates/monoblue/filelog.tmpl,
	mercurial/templates/monoblue/filerevision.tmpl,
	mercurial/templates/monoblue/footer.tmpl,
	mercurial/templates/monoblue/graph.tmpl,
	mercurial/templates/monoblue/header.tmpl,
	mercurial/templates/monoblue/index.tmpl,
	mercurial/templates/monoblue/manifest.tmpl,
	mercurial/templates/monoblue/map,
	mercurial/templates/monoblue/notfound.tmpl,
	mercurial/templates/monoblue/search.tmpl,
	mercurial/templates/monoblue/shortlog.tmpl,
	mercurial/templates/monoblue/summary.tmpl,
	mercurial/templates/monoblue/tags.tmpl,
	mercurial/templates/paper/branches.tmpl,
	mercurial/templates/paper/changeset.tmpl,
	mercurial/templates/paper/error.tmpl,
	mercurial/templates/paper/fileannotate.tmpl,
	mercurial/templates/paper/filediff.tmpl,
	mercurial/templates/paper/filelog.tmpl,
	mercurial/templates/paper/filelogentry.tmpl,
	mercurial/templates/paper/filerevision.tmpl,
	mercurial/templates/paper/footer.tmpl,
	mercurial/templates/paper/graph.tmpl,
	mercurial/templates/paper/header.tmpl,
	mercurial/templates/paper/index.tmpl,
	mercurial/templates/paper/manifest.tmpl,
	mercurial/templates/paper/map,
	mercurial/templates/paper/notfound.tmpl,
	mercurial/templates/paper/search.tmpl,
	mercurial/templates/paper/shortlog.tmpl,
	mercurial/templates/paper/shortlogentry.tmpl,
	mercurial/templates/paper/tags.tmpl,
	mercurial/templates/raw/changeset.tmpl,
	mercurial/templates/raw/error.tmpl,
	mercurial/templates/raw/fileannotate.tmpl,
	mercurial/templates/raw/filediff.tmpl,
	mercurial/templates/raw/index.tmpl,
	mercurial/templates/raw/manifest.tmpl, mercurial/templates/raw/map,
	mercurial/templates/raw/notfound.tmpl,
	mercurial/templates/rss/changelog.tmpl,
	mercurial/templates/rss/changelogentry.tmpl,
	mercurial/templates/rss/error.tmpl,
	mercurial/templates/rss/filelog.tmpl,
	mercurial/templates/rss/filelogentry.tmpl,
	mercurial/templates/rss/header.tmpl, mercurial/templates/rss/map,
	mercurial/templates/rss/tagentry.tmpl,
	mercurial/templates/rss/tags.tmpl,
	mercurial/templates/spartan/branches.tmpl,
	mercurial/templates/spartan/changelog.tmpl,
	mercurial/templates/spartan/changelogentry.tmpl,
	mercurial/templates/spartan/changeset.tmpl,
	mercurial/templates/spartan/error.tmpl,
	mercurial/templates/spartan/fileannotate.tmpl,
	mercurial/templates/spartan/filediff.tmpl,
	mercurial/templates/spartan/filelog.tmpl,
	mercurial/templates/spartan/filelogentry.tmpl,
	mercurial/templates/spartan/filerevision.tmpl,
	mercurial/templates/spartan/footer.tmpl,
	mercurial/templates/spartan/graph.tmpl,
	mercurial/templates/spartan/header.tmpl,
	mercurial/templates/spartan/index.tmpl,
	mercurial/templates/spartan/manifest.tmpl,
	mercurial/templates/spartan/map,
	mercurial/templates/spartan/notfound.tmpl,
	mercurial/templates/spartan/search.tmpl,
	mercurial/templates/spartan/shortlog.tmpl,
	mercurial/templates/spartan/shortlogentry.tmpl,
	mercurial/templates/spartan/tags.tmpl,
	mercurial/templates/static/background.png,
	mercurial/templates/static/coal-file.png, mercurial/templates/static
	/coal-folder.png, mercurial/templates/static/excanvas.js,
	mercurial/templates/static/graph.js,
	mercurial/templates/static/hgicon.png,
	mercurial/templates/static/hglogo.png, mercurial/templates/static
	/style-coal.css, mercurial/templates/static/style-gitweb.css,
	mercurial/templates/static/style-monoblue.css,
	mercurial/templates/static/style-paper.css,
	mercurial/templates/static/style.css, mercurial/templates/template-
	vars.txt, setup.py, templates/atom/changelog.tmpl,
	templates/atom/changelogentry.tmpl, templates/atom/error.tmpl,
	templates/atom/filelog.tmpl, templates/atom/header.tmpl,
	templates/atom/map, templates/atom/tagentry.tmpl,
	templates/atom/tags.tmpl, templates/coal/header.tmpl,
	templates/coal/map, templates/gitweb/branches.tmpl,
	templates/gitweb/changelog.tmpl,
	templates/gitweb/changelogentry.tmpl,
	templates/gitweb/changeset.tmpl, templates/gitweb/error.tmpl,
	templates/gitweb/fileannotate.tmpl, templates/gitweb/filediff.tmpl,
	templates/gitweb/filelog.tmpl, templates/gitweb/filerevision.tmpl,
	templates/gitweb/footer.tmpl, templates/gitweb/graph.tmpl,
	templates/gitweb/header.tmpl, templates/gitweb/index.tmpl,
	templates/gitweb/manifest.tmpl, templates/gitweb/map,
	templates/gitweb/notfound.tmpl, templates/gitweb/search.tmpl,
	templates/gitweb/shortlog.tmpl, templates/gitweb/summary.tmpl,
	templates/gitweb/tags.tmpl, templates/map-cmdline.changelog,
	templates/map-cmdline.compact, templates/map-cmdline.default,
	templates/monoblue/branches.tmpl, templates/monoblue/changelog.tmpl,
	templates/monoblue/changelogentry.tmpl,
	templates/monoblue/changeset.tmpl, templates/monoblue/error.tmpl,
	templates/monoblue/fileannotate.tmpl,
	templates/monoblue/filediff.tmpl, templates/monoblue/filelog.tmpl,
	templates/monoblue/filerevision.tmpl,
	templates/monoblue/footer.tmpl, templates/monoblue/graph.tmpl,
	templates/monoblue/header.tmpl, templates/monoblue/index.tmpl,
	templates/monoblue/manifest.tmpl, templates/monoblue/map,
	templates/monoblue/notfound.tmpl, templates/monoblue/search.tmpl,
	templates/monoblue/shortlog.tmpl, templates/monoblue/summary.tmpl,
	templates/monoblue/tags.tmpl, templates/paper/branches.tmpl,
	templates/paper/changeset.tmpl, templates/paper/error.tmpl,
	templates/paper/fileannotate.tmpl, templates/paper/filediff.tmpl,
	templates/paper/filelog.tmpl, templates/paper/filelogentry.tmpl,
	templates/paper/filerevision.tmpl, templates/paper/footer.tmpl,
	templates/paper/graph.tmpl, templates/paper/header.tmpl,
	templates/paper/index.tmpl, templates/paper/manifest.tmpl,
	templates/paper/map, templates/paper/notfound.tmpl,
	templates/paper/search.tmpl, templates/paper/shortlog.tmpl,
	templates/paper/shortlogentry.tmpl, templates/paper/tags.tmpl,
	templates/raw/changeset.tmpl, templates/raw/error.tmpl,
	templates/raw/fileannotate.tmpl, templates/raw/filediff.tmpl,
	templates/raw/index.tmpl, templates/raw/manifest.tmpl,
	templates/raw/map, templates/raw/notfound.tmpl,
	templates/rss/changelog.tmpl, templates/rss/changelogentry.tmpl,
	templates/rss/error.tmpl, templates/rss/filelog.tmpl,
	templates/rss/filelogentry.tmpl, templates/rss/header.tmpl,
	templates/rss/map, templates/rss/tagentry.tmpl,
	templates/rss/tags.tmpl, templates/spartan/branches.tmpl,
	templates/spartan/changelog.tmpl,
	templates/spartan/changelogentry.tmpl,
	templates/spartan/changeset.tmpl, templates/spartan/error.tmpl,
	templates/spartan/fileannotate.tmpl,
	templates/spartan/filediff.tmpl, templates/spartan/filelog.tmpl,
	templates/spartan/filelogentry.tmpl,
	templates/spartan/filerevision.tmpl, templates/spartan/footer.tmpl,
	templates/spartan/graph.tmpl, templates/spartan/header.tmpl,
	templates/spartan/index.tmpl, templates/spartan/manifest.tmpl,
	templates/spartan/map, templates/spartan/notfound.tmpl,
	templates/spartan/search.tmpl, templates/spartan/shortlog.tmpl,
	templates/spartan/shortlogentry.tmpl, templates/spartan/tags.tmpl,
	templates/static/background.png, templates/static/coal-file.png,
	templates/static/coal-folder.png, templates/static/excanvas.js,
	templates/static/graph.js, templates/static/hgicon.png,
	templates/static/hglogo.png, templates/static/style-coal.css,
	templates/static/style-gitweb.css, templates/static/style-
	monoblue.css, templates/static/style-paper.css,
	templates/static/style.css, templates/template-vars.txt:
	setup: install translation files as package data.

	Remove the `install_package_data' subclass of `install_data' and use
	the `package_data' functionality provided by distutils instead. As
	package data must be located within the package directory, the data
	files are now generated in the build directory.

	To simplify the functionality of this change, the top-level `doc'
	and `templates' directories have been moved into the `mercurial'
	package directory.
	[29d52513a530] [install-package-data.diff]

2009-12-01  Dan Villiom Podlaski Christiansen  <danchr at gmail.com>

	* setup.py:
	setup: expand configuration variables in data paths.

	Subclass the `install_data' in order to allow paths to installed
	data to refer to configuration variables such as $dist_name or
	$dist_version. This is primarily useful for distributors.

	Please note that this changeset doesn't actually *use* the new
	functionality; it merely introduces the infrastructure.
	[3f6ef7734ae6] [install-dirs.diff]

2009-11-26  Dan Villiom Podlaski Christiansen  <danchr at gmail.com>

	* setup.py:
	setup: add missing `share' directory to install_data on UNIX
	platforms.

	Technically, this is a hack; we modify a "constant" in distutils.
	However, `install_data' incorrectly defaults to e.g. "$base" in the
	`unix_home' and `unix_prefix' schemes, rather than the proper
	"$base/share", so we fix it. The paths will not be modified if they
	contain a `/' as it would indicate that the bug was fixed.
	[adebbf903551] [install-data-dir.diff]

2009-11-30  Dan Villiom Podlaski Christiansen  <danchr at gmail.com>

	* contrib/bash/hg, contrib/bash_completion, contrib/zsh/_hg,
	contrib/zsh_completion, setup.py:
	setup: install some useful data files.

	The selection is somewhat arbitrary. In the case of the Zsh
	completion file, it will not conflict with the builtin Zsh
	completions: they are in a file named `_mercurial', not `_hg'.
	[4a4fa19cd99d] [install-data.diff]

2009-12-01  Dan Villiom Podlaski Christiansen  <danchr at gmail.com>

	* Makefile, contrib/mercurial.spec, doc/Makefile, doc/__init__.py,
	doc/manpage.py, doc/rst2man.py, setup.py:
	setup: generate, build & install documentation using distutils &
	docutils.

	Add a new dedicated build command for generating & installing the
	documentation. Unfortunately, this stage is somewhat complex. The
	motivation for this change is described in the source docstrings in
	`setup.py'.

	Add a `doc-format' option, which selects the documentation formats
	to build. The defaults is to install both formats --- manual pages
	as well as HTML --- on UNIX, and only HTML elsewhere.

	Turn the `doc' directory into a package by adding an empty
	__init__.py file. Also, rename `rst2man.py' to `manpage.py',
	reflecting its new role.

	Remove the Makefile in `doc', as it is now redundant. Strip out
	references to it from the top-level Makefile.

	Remove references the `doc' Makefile from the RPM build
	specification. Instead, pass --install-man and --install-html to the
	distutils build. (The latter differs from the Mercurial default by
	adding the version. Note that the build specification hasn't been
	tested thoroughly.)
	[2b45949ca5a9] [install-documentation.diff]

2009-12-01  Dan Villiom Podlaski Christiansen  <danchr at gmail.com>

	* Makefile, setup.py:
	setup: build the documentation in a subdirectory of `build_temp'.
	[ad2cffaeaf92] [install-data-temp.diff]

2009-11-30  Dan Villiom Podlaski Christiansen  <danchr at gmail.com>

	* setup.py:
	setup: omit manual category in HTML documentation file names.

	The manual category --- e.g. the `5' in hgrc.5 --- is not relevant
	when generating the HTML documentation. This tiny change causes the
	generated & installed files to be named only e.g. `hgrc.html' rather
	than `hgrc.5.html'.

	Please note that this may require redirects on servers hosting the
	documentation.
	[fd584f300ac6] [install-no-html-category.diff]



More information about the Mercurial-devel mailing list