Skip to content

openfoam-selector man page varies from date

While working on reproducible builds for openSUSE, I found that our science/openfoam-selector package varied from the build date.

We would like to be able to recreate bit-identical build results.

Cannot fork here, so please use git am to get this commit:

From 720af8dfbf917c63cd599fbceda6fd0561612ba5 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Sun, 9 Aug 2020 05:42:57 +0200
Subject: [PATCH] Use VERSION mtime for MAN_DATE

to allow to get identical build results later.
See https://reproducible-builds.org/ for why this is good.

This date call works with GNU date and FreeBSD date.

This PR was done while working on reproducible builds for openSUSE.
---
 openfoam-selector/configure    | 2 +-
 openfoam-selector/configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/openfoam-selector/configure b/openfoam-selector/configure
index 26ce056..469a768 100755
--- a/openfoam-selector/configure
+++ b/openfoam-selector/configure
@@ -2400,7 +2400,7 @@ OPENFOAM_SELECTOR_HOME_FILE=".openfoam-selector"
 prefix=$prefix_save

 # Information for the man page
-MAN_DATE=`date "+%Y-%m-%d"`
+MAN_DATE=`date -u -r VERSION "+%Y-%m-%d"`


 # Party on
diff --git a/openfoam-selector/configure.ac b/openfoam-selector/configure.ac
index 6cceaa0..81db397 100644
--- a/openfoam-selector/configure.ac
+++ b/openfoam-selector/configure.ac
@@ -67,7 +67,7 @@ AC_SUBST(OPENFOAM_SELECTOR_HOME_FILE)
 prefix=$prefix_save

 # Information for the man page
-MAN_DATE=`date "+%Y-%m-%d"`
+MAN_DATE=`date -u -r VERSION "+%Y-%m-%d"`
 AC_SUBST(MAN_DATE)

 # Party on

Alternative patches are possible using https://reproducible-builds.org/specs/source-date-epoch/