[apache2] 03/04: Made build reproducible

Jean-Michel Vourgère nirgal at moszumanska.debian.org
Thu May 28 15:51:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

nirgal pushed a commit to branch master
in repository apache2.

commit 6a94f8fade10ed44a9695a3efd6857c39e9dd725
Author: Jean-Michel Vourgère <nirgal at debian.org>
Date:   Thu May 28 17:43:18 2015 +0200

    Made build reproducible
    
    server/buildmark.c now uses the date from the debian changelog.
---
 debian/patches/reproducible_builds.diff | 24 ++++++++++++++++++++++++
 debian/patches/series                   |  1 +
 debian/rules                            |  3 ++-
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/debian/patches/reproducible_builds.diff b/debian/patches/reproducible_builds.diff
new file mode 100644
index 0000000..a48de52
--- /dev/null
+++ b/debian/patches/reproducible_builds.diff
@@ -0,0 +1,24 @@
+Description: Make builds reproducible
+ Don't use __DATE__ __TIME__.
+ Use changelog date instead.
+Author: Jean-Michel Vourgère <nirgal at debian.org>
+Forwarded: not-needed
+Last-Update: 2015-05-28
+
+Index: apache2/server/buildmark.c
+===================================================================
+--- apache2.orig/server/buildmark.c
++++ apache2/server/buildmark.c
+@@ -17,11 +17,7 @@
+ #include "ap_config.h"
+ #include "httpd.h"
+ 
+-#if defined(__DATE__) && defined(__TIME__)
+-static const char server_built[] = __DATE__ " " __TIME__;
+-#else
+-static const char server_built[] = "unknown";
+-#endif
++static const char server_built[] = BUILD_DATETIME;
+ 
+ AP_DECLARE(const char *) ap_get_server_built()
+ {
diff --git a/debian/patches/series b/debian/patches/series
index c9ff599..6bedd04 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,6 +6,7 @@ build_suexec-custom.patch
 CVE-2015-0228_mod_lua.diff
 mpm_event_crash.diff
 CVE-2015-0253_ErrorDocument.diff
+reproducible_builds.diff
 
 # This patch is applied manually
 #suexec-custom.patch
diff --git a/debian/rules b/debian/rules
index aa8f16d..451c169 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,11 +12,12 @@ include /usr/share/dpkg/buildflags.mk
 LSB_RELEASE := $(shell lsb_release -i -s)
 SERVER_VERSION := $(shell dpkg-parsechangelog | perl -ne 'print $$1 if m/Version:\s*([\d\.]+)/')
 DEBIAN_VERSION := $(shell dpkg-parsechangelog | perl -ne 'print $$1 if m/Version:\s*(.+)/')
+BUILD_DATETIME := $(shell date -u --date="`dpkg-parsechangelog -S Date`" +%FT%T)
 MODULE_DIR := /usr/lib/apache2/modules/
 API = $(shell perl -ne 'print $$1 if m/define\s+MODULE_MAGIC_NUMBER_MAJOR\s+?(.*)$$/' < include/ap_mmn.h)
 AP2_CFLAGS = -pipe $(CFLAGS)
 AP2_LDFLAGS = -Wl,--as-needed $(LDFLAGS)
-AP2_CPPFLAGS = -DPLATFORM='\"$(LSB_RELEASE)\"' $(CPPFLAGS)
+AP2_CPPFLAGS = -DPLATFORM='\"$(LSB_RELEASE)\"' -DBUILD_DATETIME='\"$(BUILD_DATETIME)\"' $(CPPFLAGS)
 AP2_LTFLAGS = --no-silent
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-apache/apache2.git



More information about the Pkg-apache-commits mailing list