Index: common/conf.py
===================================================================
--- common/conf.py	(revision 30e5832dea28bb537c8a1d4de6361c2bac58033d)
+++ common/conf.py	(revision 07f151f4579458de8b6255cd88509e9a5d86ade1)
@@ -1,3 +1,3 @@
-import version as rtems_version
+import datetime
 
 extensions = [
@@ -13,4 +13,6 @@
 ]
 
+bibtex_bibfiles = ['../common/refs.bib']
+
 extlinks = {'release_path': ('https://ftp.rtems.org/pub/rtems/releases', None) }
 
@@ -29,5 +31,5 @@
 # General information about the project.
 project = u'RTEMS Documentation Project'
-copyright = u'1988, 2020 RTEMS Project and contributors'
+copyright = u'1988, ' + str(datetime.datetime.now().year) + ' RTEMS Project and contributors'
 
 # The version info for the project you're documenting, acts as replacement for
@@ -36,12 +38,8 @@
 #
 # The short X.Y version.
-version = rtems_version.version()
+#version = rtems_version.version()
 
 # The full version, including alpha/beta/rc tags.
-release = rtems_version.string()
-
-major = rtems_version.major()
-minor = rtems_version.minor()
-revision = rtems_version.revision()
+#release = rtems_version.string()
 
 # The language for content autogenerated by Sphinx. Refer to documentation
@@ -75,4 +73,7 @@
 # The name of the Pygments (syntax highlighting) style to use.
 pygments_style = 'sphinx'
+
+# http://www.sphinx-doc.org/en/master/usage/configuration.html#confval-numfig
+numfig = True
 
 # A list of ignored prefixes for module index sorting.
Index: common/latex.py
===================================================================
--- common/latex.py	(revision 30e5832dea28bb537c8a1d4de6361c2bac58033d)
+++ common/latex.py	(revision 07f151f4579458de8b6255cd88509e9a5d86ade1)
@@ -4,5 +4,4 @@
 
 import os
-import platform
 import re
 
@@ -83,5 +82,9 @@
     uname = os.uname()
     if uname[0] == 'Linux':
-        distro = platform.dist()
+        try:
+            from distro import linux_distribution
+        except:
+            from platform import linux_distribution
+        distro = linux_distribution()
         name = '%s/%s' % (uname[0], distro[0])
         version = distro[1]
Index: common/rtemsdomain.py
===================================================================
--- common/rtemsdomain.py	(revision 30e5832dea28bb537c8a1d4de6361c2bac58033d)
+++ common/rtemsdomain.py	(revision 07f151f4579458de8b6255cd88509e9a5d86ade1)
@@ -8,4 +8,6 @@
 from sphinx.util.nodes import make_refnode
 from sphinx.util.docfields import Field, TypedField
+
+import version as rtems_version
 
 """
@@ -31,26 +33,26 @@
 
 role_url = {
-	"trac": 			("Trac",				"https://devel.rtems.org"),
-	"devel": 			("Developer Site",		"https://devel.rtems.org"),
-	"www":				("RTEMS Home",			"https://www.rtems.org/"),
-	"buildbot":			("Buildbot Instance",	"https://buildbot.rtems.org/"),
-	"builder":			("Builder Site",		"https://builder.rtems.org/"),
-	"docs":				("Documentation Site",	"https://docs.rtems.org/"),
-	"lists":			("Mailing Lists",		"https://lists.rtems.org/"),
-	"git":				("Git Repositories",	"https://git.rtems.org/"),
-	"ftp":				("FTP File Server",	"https://ftp.rtems.org/"),
-	"review":			("Gerrit Code Review",	"https://review.rtems.org/"),
-	"bugs":				("Bugs Database",		"https://devel.rtems.org/wiki/Bugs/"),
-	"gsoc":				("Google Summer of Code", "https://devel.rtems.org/wiki/GSoC/"),
-	"socis":			("ESA SOCIS",			"https://devel.rtems.org/wiki/SOCIS/")
+	"trac": 	("Trac",			"https://devel.rtems.org"),
+	"devel": 	("Developer Site",		"https://devel.rtems.org"),
+	"www":		("RTEMS Home",			"https://www.rtems.org/"),
+	"buildbot":	("Buildbot Instance",		"https://buildbot.rtems.org/"),
+	"builder":	("Builder Site",		"https://builder.rtems.org/"),
+	"docs":		("Documentation Site",		"https://docs.rtems.org/"),
+	"lists":	("Mailing Lists",		"https://lists.rtems.org/"),
+	"git":		("Git Repositories",		"https://git.rtems.org/"),
+	"ftp":		("FTP File Server",		"https://ftp.rtems.org/"),
+	"review":	("Gerrit Code Review",		"https://review.rtems.org/"),
+	"bugs":		("Bugs Database",		"https://devel.rtems.org/wiki/Bugs/"),
+	"gsoc":		("Google Summer of Code", 	"https://devel.rtems.org/wiki/GSoC/"),
+	"socis":	("ESA SOCIS",			"https://devel.rtems.org/wiki/SOCIS/")
 }
 
 
 role_list = {
-	"announce":	("Announce Mailing List",			"https://lists.rtems.org/mailman/listinfo/announce/"),
-	"bugs":		("Bugs Mailing List",				"https://lists.rtems.org/mailman/listinfo/bugs/"),
-	"devel":	("Developers Mailing List",			"https://lists.rtems.org/mailman/listinfo/devel/"),
-	"build":	("Build Logs",					"https://lists.rtems.org/mailman/listinfo/build"),
-	"users":	("Users Mailing List",				"https://lists.rtems.org/mailman/listinfo/users/"),
+	"announce":	("Announce Mailing List",		"https://lists.rtems.org/mailman/listinfo/announce/"),
+	"bugs":		("Bugs Mailing List",			"https://lists.rtems.org/mailman/listinfo/bugs/"),
+	"devel":	("Developers Mailing List",		"https://lists.rtems.org/mailman/listinfo/devel/"),
+	"build":	("Build Logs",				"https://lists.rtems.org/mailman/listinfo/build"),
+	"users":	("Users Mailing List",			"https://lists.rtems.org/mailman/listinfo/users/"),
 	"vc":		("Version Control Mailing List",	"https://lists.rtems.org/mailman/listinfo/vc/"),
 }
@@ -120,6 +122,32 @@
 
 
+def rtems_replace(app, docname, source):
+	dump = False
+	line = source[0]
+	for key in app.config.replacements:
+		line = line.replace(key, app.config.replacements[key])
+	source[0] = line
+
+replacements = {
+}
 
 def setup(app):
+	app.add_config_value('rtems_major', str(app.config.overrides['rtems_major']), True)
+	app.add_config_value('rtems_minor', str(app.config.overrides['rtems_minor']), True)
+	app.add_config_value('rtems_revision', str(app.config.overrides['rtems_revision']), True)
+	major = str(app.config.overrides['rtems_major'])
+	minor = str(app.config.overrides['rtems_minor'])
+	revision = str(app.config.overrides['rtems_revision'])
+	if revision.isdigit():
+		majminrev = major + '.' + minor + '.' + revision
+	else:
+		majminrev = major + '.' + revision
+	replacements["@rtems-version@"] = str(app.config.overrides['version'])
+	replacements["@rtems-ver-major@"] = major
+	replacements["@rtems-ver-minor@"] = minor
+	replacements["@rtems-ver-revision@"] = revision
+	replacements["@rtems-ver-majminrev@"] = majminrev
+	app.add_config_value('replacements', replacements, True)
+	app.connect('source-read', rtems_replace)
 	app.add_domain(RTEMSDomain)
 	return {'version': "1.0", 'parallel_read_safe': True}
Index: common/version.py
===================================================================
--- common/version.py	(revision 30e5832dea28bb537c8a1d4de6361c2bac58033d)
+++ common/version.py	(revision 07f151f4579458de8b6255cd88509e9a5d86ade1)
@@ -112,4 +112,7 @@
 def get(ctx, rtems_major_version):
     global _version
+    global _major
+    global _minor
+    global _revision
     global _date
     global _released
@@ -185,5 +188,5 @@
 
 def revision():
-    return revision
+    return _revision
 
 def date():
Index: common/waf.py
===================================================================
--- common/waf.py	(revision 30e5832dea28bb537c8a1d4de6361c2bac58033d)
+++ common/waf.py	(revision 07f151f4579458de8b6255cd88509e9a5d86ade1)
@@ -182,5 +182,10 @@
         rst_node = bld.srcnode.make_node('testbuild/contents.rst')
         rst_node.parent.mkdir()
-        rst_node.write('.. COMMENT test sphinx\n')
+        rst_node.write('.. COMMENT test sphinx' + os.linesep)
+        bib_node = bld.srcnode.make_node('testbuild/refs.bib')
+        bib_node.write(os.linesep)
+        conf_node = bld.srcnode.make_node('testbuild/conf.py')
+        conf_node.write(os.linesep.join(["master_doc='contents'",
+                                         "bibtex_bibfiles = ['refs.bib']"]))
         bld(rule = bld.kw['rule'], source = rst_node)
 
@@ -188,5 +193,5 @@
     try:
         ctx.run_build(fragment = 'xx',
-                      rule = "${BIN_SPHINX_BUILD} -b html -D extensions=%s -C . out" % (extension),
+                      rule = "${BIN_SPHINX_BUILD} -b html -D extensions=%s -c . . out" % (extension),
                       build_fun = run_sphinx,
                       env = ctx.env)
@@ -267,5 +272,5 @@
         ctx.env.BUILD_PDF = 'yes'
 
-    ctx.envBUILD_SINGLEHTML = 'no'
+    ctx.env.BUILD_SINGLEHTML = 'no'
     if ctx.options.singlehtml:
         check_inliner = not ctx.env.BIN_INLINER
@@ -277,5 +282,5 @@
                           "(https://github.com/remy/inliner)")
 
-    ctx.envBUILD_PLANTUML = 'no'
+    ctx.env.BUILD_PLANTUML = 'no'
     if ctx.options.plantuml:
         check_plantuml = not ctx.env.BIN_PUML
@@ -287,5 +292,5 @@
                           "(https://www.npmjs.com/package/node-plantuml)")
 
-    ctx.envBUILD_DITAA = 'no'
+    ctx.env.BUILD_DITAA = 'no'
     if ctx.options.ditaa:
         #
@@ -336,4 +341,6 @@
                                                                ctx.path.name))
     )
+    env_latex = ctx.env.derive()
+    env_latex.TEXINPUTS = output_dir + ':'
     ctx(
         features     = 'tex',
@@ -341,5 +348,6 @@
         type         = ctx.env.LATEX_CMD,
         source       = "%s/%s.tex" % (buildtype, ctx.path.name),
-        prompt       = 0
+        prompt       = 0,
+        env          = env_latex
     )
     ctx.install_files('${PREFIX}',
