From 48289843b55f298de8ed555f50b3bbd29c16fd06 Mon Sep 17 00:00:00 2001
From: Chris Lamb <chris@chris-lamb.co.uk>
Date: Mon, 27 Nov 2017 10:28:58 +0900
Subject: [PATCH] Make the build reproducible.

Whilst working on the Reproducible Builds effort [0], we noticed
that fswatch could not be built reproducibly.

This is because the manpage used the output of the date(1) cmd.

This has been filed in Debian as #882818 [1].

 [0] https://reproducible-builds.org/
 [1] https://bugs.debian.org/882818
---
 configure.ac | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index b3e0644e..66c0b4c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -286,6 +286,9 @@ AS_VAR_IF([use_docker], [yes],
 
 # Variables used in man files.
 MAN_DATE=$(date +'%B %d, %Y')
+if test -n "$SOURCE_DATE_EPOCH"; then
+  MAN_DATE=$(LC_ALL=C date --utc --date=@$SOURCE_DATE_EPOCH +'%B %d, %Y')
+fi
 FSWATCH=${PACKAGE_NAME}
 MAN_BUG_REPORT=${PACKAGE_BUGREPORT}
 

