Source: gnarwl
Version: 3.6.dfsg-6.2
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 the "reproducible builds" effort [1], we have noticed
that gnarwl could not be built reproducibly.

The attached patch removes timestamps from the build system. Once
applied, gnarwl can be built reproducibly in our reproducible
toolchain.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
diff -urNad gnarwl.orig/gnarwl-3.6.dfsg/debian/patches/reproducible_build 
gnarwl/gnarwl-3.6.dfsg/debian/patches/reproducible_build
--- gnarwl.orig/gnarwl-3.6.dfsg/debian/patches/reproducible_build       
1970-01-01 01:00:00.000000000 +0100
+++ gnarwl/gnarwl-3.6.dfsg/debian/patches/reproducible_build    2015-02-25 
00:15:52.553366801 +0000
@@ -0,0 +1,52 @@
+--- gnarwl-3.6.dfsg.orig/data/Makefile
++++ gnarwl-3.6.dfsg/data/Makefile
+@@ -19,6 +19,6 @@ install:
+       install -m 644 footer.txt $(HOMEDIR)
+       mkdir -p $(CONFDIR)/../usr/share/gnarwl
+       install -m 600 gnarwl.cfg 
$(CONFDIR)/../usr/share/gnarwl/gnarwl.cfg.template
+-      cat badheaders.txt | $(SBINDIR)/$(SBIN) -a $(HOMEDIR)/badheaders.db
+-      cat blacklist.txt | $(SBINDIR)/$(SBIN) -a $(HOMEDIR)/blacklist.db
++      cat badheaders.txt | $(SBINDIR)/$(SBIN) -na $(HOMEDIR)/badheaders.db
++      cat blacklist.txt | $(SBINDIR)/$(SBIN) -na $(HOMEDIR)/blacklist.db
+ 
+--- gnarwl-3.6.dfsg.orig/src/damnit.c
++++ gnarwl-3.6.dfsg/src/damnit.c
+@@ -14,6 +14,9 @@
+ // How to display data
+ char *format="%time -> %entry\n";
+ 
++// Whether to add a timestamp to the file
++int timestamp=1;
++
+ /**
+  * Print usage information
+  */
+@@ -22,6 +25,7 @@ void printUsage() {
+   Damnit is a tool for listing/editing gnarwl's database files.\n\
+   Options:\n\n\
+   \t-h\t\t\t print usage information\n\
++  \t-n\t\t\t don't add a timestamp to the file\n\
+   \t-d <file> [<value>]\t delete <value> from <file>\n\
+   \t-a <file> [<value>]\t add <value> to <file>\n\
+   \t-l <file>\t\t list database file\n\
+@@ -104,7 +108,7 @@ void addToFile(char *fname, char *entry)
+     exit(EXIT_FAILURE);
+   }
+ 
+-  t=time(NULL);
++  t=timestamp ? time(NULL) : 0;
+   key.dptr=entry;
+   key.dsize=strlen(entry)+1;
+   val.dptr=(char*)malloc(sizeof(t));
+@@ -158,9 +162,10 @@ int main(int argc,char **argv) {
+   
+   if (argc==1) printUsage();
+   
+-  while ((ch = getopt(argc, argv, "hf:l:a:d:")) != EOF) {
++  while ((ch = getopt(argc, argv, "hnf:l:a:d:")) != EOF) {
+     switch((char)ch) {
+       case 'h': printUsage();
++      case 'n': {timestamp=0;};
+       case 'f': {format=optarg;break;}
+       case 'l': {
+         listFile(optarg);
diff -urNad gnarwl.orig/gnarwl-3.6.dfsg/debian/patches/series 
gnarwl/gnarwl-3.6.dfsg/debian/patches/series
--- gnarwl.orig/gnarwl-3.6.dfsg/debian/patches/series   2015-02-24 
23:45:49.665739931 +0000
+++ gnarwl/gnarwl-3.6.dfsg/debian/patches/series        2015-02-25 
00:15:38.004721712 +0000
@@ -1,3 +1,4 @@
 doc.patch
 dbaccess.patch
 data-makefile.patch
+reproducible_build
diff -urNad gnarwl.orig/gnarwl-3.6.dfsg/debian/rules 
gnarwl/gnarwl-3.6.dfsg/debian/rules
--- gnarwl.orig/gnarwl-3.6.dfsg/debian/rules    2015-02-24 23:45:49.665739931 
+0000
+++ gnarwl/gnarwl-3.6.dfsg/debian/rules 2015-02-24 23:47:18.473667667 +0000
@@ -41,7 +41,7 @@
        dh_testroot
        dh_prep
        dh_installdirs
-       $(MAKE) install prefix=$(CURDIR)/debian/$(package)/usr 
DESTDIR=$(CURDIR)/debian/$(package)
+       $(MAKE) install prefix=$(CURDIR)/debian/$(package)/usr 
DESTDIR=$(CURDIR)/debian/$(package) GZIP=-9n
        rm $(CURDIR)/debian/$(package)/usr/share/doc/gnarwl/INSTALL || true
        rm -fr $(CURDIR)/debian/$(package)/etc/ldap || true
        rm -fr $(CURDIR)/debian/$(package)/var/lib/gnarwl/bin || true
_______________________________________________
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