Package: ircd-hybrid / 1:8.2.26+dfsg.1-1

reproducible_date_time.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From ad2895ba6a07114a070d6094a224d76d9fdaa3b2 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <dom@earth.li>
Date: Wed, 2 Sep 2015 22:15:22 +0100
Subject: Allow the build date/time to be overridden by BUILD_DATE

Including the current date/time in the build means that it cannot be
reproducible. Instead, BUILD_DATE can be set to a value from the source
(in the Debian project, this will be the latest changelog date).

See <https://wiki.debian.org/ReproducibleBuilds/TimestampsFromCPPMacros>
for more information.

This is the version of the patch modified by
Michael Wobst <wobst.michael@web.de> and applied upstream

Patch-Name: reproducible_date_time.patch
Origin: https://github.com/ircd-hybrid/ircd-hybrid/commit/ff413b31ea4d89fa3fc460bdb66dafd6c1b9856d
Bug: https://github.com/ircd-hybrid/ircd-hybrid/pull/3
---
 src/Makefile.am | 4 +++-
 src/user.c      | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 6355fe2..92cb064 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,9 +2,11 @@ AUTOMAKE_OPTIONS = foreign
 
 sbin_PROGRAMS = ircd
 
+BUILD_DATE ?= $(shell LANG=C date '+%B %-e %Y at %T%z')
+
 AM_YFLAGS = -d
 
-AM_CPPFLAGS = $(LTDLINCL) -I$(top_srcdir)/include
+AM_CPPFLAGS = $(LTDLINCL) -I$(top_srcdir)/include -DBUILD_DATE="\"$(BUILD_DATE)\""
 ircd_LDFLAGS = -export-dynamic
 ircd_LDADD = $(LIBLTDL)
 ircd_DEPENDENCIES = $(LTDLDEPS)
diff --git a/src/user.c b/src/user.c
index eec3a5c..e9e0c82 100644
--- a/src/user.c
+++ b/src/user.c
@@ -255,7 +255,11 @@ introduce_client(struct Client *client_p)
 static void
 user_welcome(struct Client *client_p)
 {
+#ifdef BUILD_DATE
+  static const char built_date[] = BUILD_DATE;
+#else
   static const char built_date[] = __DATE__ " at " __TIME__;
+#endif
 
   if (HasFlag(client_p, FLAGS_SSL))
   {