Source: mrd6
Version: 0.9.6-12
Severity: wishlist
Tags: patch upstream
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that mrd6 could not be built reproducibly.
It embeds the build date into the binary.

The attached patch strips this to enable reproducible building.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/0015-reproducible-build.patch b/debian/patches/0015-reproducible-build.patch
new file mode 100644
index 0000000..3e97034
--- /dev/null
+++ b/debian/patches/0015-reproducible-build.patch
@@ -0,0 +1,32 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Strip build date to enable reproducible building
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -179,7 +179,7 @@
+ $(MRD_VERSION_CPP): $(SOURCES) Makefile Makefile.options
+ 	@set -e; mkdir -p $(dir $@); \
+ 		echo '/* This file is automatically generated */' > $(MRD_VERSION_CPP); \
+-		echo 'const char *BuildDate = "$(NOW)";' >> $(MRD_VERSION_CPP)
++		echo 'const char *BuildDate = "unknown";' >> $(MRD_VERSION_CPP)
+ 
+ $(MODULES_CPP): Makefile Makefile.options
+ 	@set -e; mkdir -p $(dir $@); \
+--- a/src/mrd.cpp
++++ b/src/mrd.cpp
+@@ -74,7 +74,6 @@
+ 
+ mrd *g_mrd = 0;
+ 
+-extern const char *BuildDate;
+ static const char *VersionInfo = "mrd6 0.9.6 ($Rev: 1711 $)";
+ 
+ static const char *defaultconffiles[] = {
+@@ -2333,7 +2332,6 @@
+ 
+ void mrd::show_base_info(base_stream &out) const {
+ 	out.xprintf("Version: %s\n", VersionInfo);
+-	out.xprintf("Build date: %s\n", BuildDate);
+ }
+ 
+ bool mrd::show_info(base_stream &out, const std::vector<std::string> &ctx) {
diff --git a/debian/patches/series b/debian/patches/series
index 0382f41..b9ad71b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -12,3 +12,4 @@
 0012-Always-allow-flags-to-be-set-from-environment.patch
 0013-Interpret-syslog-buffer-string-as-string-only.patch
 0014-Correctly-detect-and-enable-new-interfaces.patch
+0015-reproducible-build.patch

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to