Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.0.x: reproducible builds: use consistent date in man pages #10778

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2480,21 +2480,30 @@ return 0;

AM_CONDITIONAL([HAS_FUZZLDFLAGS], [test "x$has_sanitizefuzzer" = "xyes"])

# get revision
if test -f ./revision; then
REVISION=`cat ./revision`
AC_DEFINE_UNQUOTED([REVISION],[${REVISION}],[Git revision])
# get git revision and last commit date
AC_PATH_PROG(HAVE_GIT_CMD, git, "no")
if test "$HAVE_GIT_CMD" != "no"; then
if [ test -e .git ]; then
REVISION=`git rev-parse --short HEAD`
LAST_COMMIT_DATE=`git log -1 --date=short --pretty=format:%cd`
REVISION="$REVISION $LAST_COMMIT_DATE"
AC_DEFINE_UNQUOTED([REVISION],[${REVISION}],[Git revision])
fi
fi

# Get the release date. If LAST_COMMIT_DATE was set in the previous
# step, use it, otherwise parse it from the ChangeLog.
AC_MSG_CHECKING([for release date])
if test "x$LAST_COMMIT_DATE" != "x"; then
RELEASE_DATE=$LAST_COMMIT_DATE
else
AC_PATH_PROG(HAVE_GIT_CMD, git, "no")
if test "$HAVE_GIT_CMD" != "no"; then
if [ test -d .git ]; then
REVISION=`git rev-parse --short HEAD`
DATE=`git log -1 --date=short --pretty=format:%cd`
REVISION="$REVISION $DATE"
AC_DEFINE_UNQUOTED([REVISION],[${REVISION}],[Git revision])
fi
RELEASE_DATE=`awk '/^[[0-9\.]]+ -- [[0-9]][[0-9]][[0-9]][[0-9]]-[[0-9]][[0-9]]-[[0-9]][[0-9]]/ { print $3; exit }' $srcdir/ChangeLog`
if test "x$RELEASE_DATE" = "x"; then
AC_MSG_ERROR([Failed to determine release date])
fi
fi
AC_MSG_RESULT([${RELEASE_DATE}])
AC_SUBST(RELEASE_DATE)

# get MAJOR_MINOR version for embedding in configuration file.
MAJOR_MINOR=`expr "${PACKAGE_VERSION}" : "\([[0-9]]\+\.[[0-9]]\+\).*"`
Expand Down
1 change: 1 addition & 0 deletions doc/userguide/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
6 changes: 5 additions & 1 deletion doc/userguide/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
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,
Expand Down Expand Up @@ -67,7 +71,7 @@
version = os.environ.get('version', None)
if not version:
version = re.search(
"AC_INIT\(\[suricata\],\s*\[(.*)?\]\)",
r"AC_INIT\(\[suricata\],\s*\[(.*)?\]\)",
open("../../configure.ac").read()).groups()[0]
if not version:
version = "unknown"
Expand Down
Loading