From 51bf1c35103261d075a283d103371a2d9a8a76f7 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Mon, 1 Apr 2024 10:35:39 -0600 Subject: [PATCH] docs/userguide: use a consistent date for reproducible builds 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 | 1 + doc/userguide/conf.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/userguide/Makefile.am b/doc/userguide/Makefile.am index bd157920cf..8ffede5974 100644 --- a/doc/userguide/Makefile.am +++ b/doc/userguide/Makefile.am @@ -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) \ diff --git a/doc/userguide/conf.py b/doc/userguide/conf.py index f0ce911ce8..959744e88b 100644 --- a/doc/userguide/conf.py +++ b/doc/userguide/conf.py @@ -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, -- 2.47.2