summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Michel Vourgère <nirgal@debian.org>2015-05-28 17:43:18 +0200
committerJean-Michel Vourgère <nirgal@debian.org>2015-05-28 17:43:18 +0200
commit6a94f8fade10ed44a9695a3efd6857c39e9dd725 (patch)
treec411836b2b09240aa7fa9a719fd3f601bdc5c7e9
parentad94744da70cb00dd81c91063499f95d9e9a3564 (diff)
downloadapache2-6a94f8fade10ed44a9695a3efd6857c39e9dd725.tar.gz
Made build reproducible
server/buildmark.c now uses the date from the debian changelog.
-rw-r--r--debian/patches/reproducible_builds.diff24
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules3
3 files changed, 27 insertions, 1 deletions
diff --git a/debian/patches/reproducible_builds.diff b/debian/patches/reproducible_builds.diff
new file mode 100644
index 00000000..a48de52f
--- /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@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 c9ff5996..6bedd046 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 aa8f16dc..451c1692 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