]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
docs/userguide: use a consistent date for reproducible builds
authorJason Ish <jason.ish@oisf.net>
Mon, 1 Apr 2024 16:35:39 +0000 (10:35 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 4 Apr 2024 13:50:25 +0000 (15:50 +0200)
By default, when Sphinx generates the man pages, the current date will
be embedded in them. This can be set to a specific date with the
"today" variable. Typically the date embedded in manpages in the
release date.

To achieve this, attempt to use the environment variable, RELEASE_DATE
to set the "today" variable, reverting back to the empty string if not
set. It is up to our build system to properly set this date.

Ticket: #6911

doc/userguide/Makefile.am
doc/userguide/conf.py

index bd157920cfac7ff30e0c599cbd5dba75c5d8f63e..8ffede5974b00b089200acc42c67beb5b838fc85 100644 (file)
@@ -74,6 +74,7 @@ userguide.pdf: _build/latex/Suricata.pdf
 pdf: userguide.pdf
 
 _build/man: manpages/suricata.rst manpages/suricatasc.rst manpages/suricatactl.rst manpages/suricatactl-filestore.rst
+       RELEASE_DATE=$(RELEASE_DATE) \
        sysconfdir=$(sysconfdir) \
        localstatedir=$(localstatedir) \
        version=$(PACKAGE_VERSION) \
index f0ce911ce8ad53d16e7cc6940aeceba5be24fa79..959744e88b7b83ff49d73e1f26932f49598ca0ba 100644 (file)
@@ -19,6 +19,10 @@ import re
 import subprocess
 import datetime
 
+# Set 'today'. This will be used as the man page date. If an empty
+# string todays date will be used.
+today = os.environ.get('RELEASE_DATE', '')
+
 on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
 
 # If extensions (or modules to document with autodoc) are in another directory,