mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Merge branch '2782-set-version-and-release-variables-in-conf.py' into 'main'
Set version and release variables in conf.py Closes #2782 See merge request isc-projects/bind9!5205
This commit is contained in:
@@ -15,11 +15,11 @@ common_SPHINXOPTS = \
|
||||
-a \
|
||||
$(SPHINX_V)
|
||||
|
||||
# The "today" variable set below is not directly used in the ARM, but its value
|
||||
# is implicitly inserted on the title page of the PDF file produced by Sphinx.
|
||||
ALLSPHINXOPTS = \
|
||||
$(common_SPHINXOPTS) \
|
||||
-D version="$(PACKAGE_VERSION)" \
|
||||
-D today="$(RELEASE_DATE)" \
|
||||
-D release="$(PACKAGE_VERSION)" \
|
||||
$(SPHINXOPTS) \
|
||||
$(srcdir)
|
||||
|
||||
|
@@ -65,7 +65,7 @@ install-singlehtml: singlehtml
|
||||
cp -R $(SPHINXBUILDDIR)/singlehtml/_static/* $(DESTDIR)/$(docdir)/_static/
|
||||
|
||||
epub:
|
||||
$(AM_V_SPHINX)$(SPHINX_BUILD) -b epub -A today=$(RELEASE_DATE) -d $(SPHINXBUILDDIR)/.doctrees/epub $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/epub
|
||||
$(AM_V_SPHINX)$(SPHINX_BUILD) -b epub -d $(SPHINXBUILDDIR)/.doctrees/epub $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/epub
|
||||
|
||||
install-epub:
|
||||
$(INSTALL) -d $(DESTDIR)/$(docdir)
|
||||
|
@@ -11,6 +11,8 @@
|
||||
|
||||
# flake8: noqa: E501
|
||||
|
||||
import re
|
||||
|
||||
from typing import List, Tuple
|
||||
|
||||
from docutils import nodes
|
||||
@@ -105,6 +107,21 @@ project = 'BIND 9'
|
||||
copyright = '2021, Internet Systems Consortium'
|
||||
author = 'Internet Systems Consortium'
|
||||
|
||||
m4_vars = {}
|
||||
with open('../../configure.ac', encoding='utf-8') as configure_ac:
|
||||
for line in configure_ac:
|
||||
match = re.match(r'm4_define\(\[(?P<key>bind_VERSION_[A-Z]+)\], (?P<val>[^)]*)\)dnl', line)
|
||||
if match:
|
||||
m4_vars[match.group('key')] = match.group('val')
|
||||
|
||||
version = '%s.%s.%s%s' % (
|
||||
m4_vars['bind_VERSION_MAJOR'],
|
||||
m4_vars['bind_VERSION_MINOR'],
|
||||
m4_vars['bind_VERSION_PATCH'],
|
||||
m4_vars['bind_VERSION_EXTRA'],
|
||||
)
|
||||
release = version
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
|
Reference in New Issue
Block a user