Source: miwm
Version: 1.1-3
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-CC: reproducible-builds@lists.alioth.debian.org

Hi!

While working on Debian's “reproducible builds” effort [1], we have
noticed that miwm doesn't build reproducibly.
It embeds the current date into the manpage.

The attached patch fixes this by using the last changelog date
as a timestamp that will be embedded.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds




















diff --git a/debian/patches/reproducible_build.patch b/debian/patches/reproducible_build.patch
new file mode 100644
index 0000000..ad25320
--- /dev/null
+++ b/debian/patches/reproducible_build.patch
@@ -0,0 +1,45 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Remove timestamp from binary to enable reproducible builds.
+
+Index: miwm-1.1/error.cc
+===================================================================
+--- miwm-1.1.orig/error.cc
++++ miwm-1.1/error.cc
+@@ -41,8 +41,7 @@ miAbort(const char *s)
+ {
+   fprintf(stderr, "%s: %s\n", argv0, s);
+   cout << endl;
+-  cout << "Terminating MIWM at ";
+-  cout << __TIME__<<", "<<__DATE__<<endl<<flush;
++  cout << "Terminating MIWM" << endl << flush;
+ 
+   StopMemoryLeakCheck();
+ 
+Index: miwm-1.1/manage.cc
+===================================================================
+--- miwm-1.1.orig/manage.cc
++++ miwm-1.1/manage.cc
+@@ -171,8 +171,7 @@ Terminate(int) { // parameter signal is
+ 
+   StopMemoryLeakCheck();
+ 
+-  cout << "Terminated MIWM at ";
+-  cout << __TIME__<<", "<<__DATE__<<endl<<flush;
++  cout << "Terminated MIWM" << endl << flush;
+ 
+   exit(EXIT_FAILURE);
+ 
+Index: miwm-1.1/miwm.cc
+===================================================================
+--- miwm-1.1.orig/miwm.cc
++++ miwm-1.1/miwm.cc
+@@ -131,8 +131,7 @@ main(int argc, char *argv[])  {  // (int
+ //    SHOWMESIZE(WindowManager);
+ //    //   SHOWMESIZE(MenuItem);
+ 
+-   COUT << "Starting a MIWM that was compiled at ";
+-   COUT << __TIME__<<", "<<__DATE__<<endl;
++   COUT << "Starting a MIWM" << endl;
+    COUT << MIWMVersionID << endl << flush;
+    COUT << endl << flush;
+   
diff --git a/debian/patches/series b/debian/patches/series
index 3279018..df09d0f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
 30-miAbort-fix-argdef.patch
 40-change-bash-to-sh.patch
 50-Makefile-etags.patch
+reproducible_build.patch
diff --git a/debian/pod2man.mk b/debian/pod2man.mk
index 450fa9a..e8c7d36 100644
--- a/debian/pod2man.mk
+++ b/debian/pod2man.mk
@@ -38,9 +38,10 @@ endif
 PACKAGE		?= package
 
 # Optional variables to set
+BUILD_DATE	?= $$(dpkg-parsechangelog -S Date -lchangelog)
 MANSECT		?= 1
 PODCENTER 	?= User Commands
-PODDATE		?= $$(date "+%Y-%m-%d")
+PODDATE		?= $$(date -u "+%Y-%m-%d" -d "$(BUILD_DATE)")
 
 # Directories
 MANSRC		?=

Attachment: signature.asc
Description: OpenPGP 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