Source: dacs
Version: 1.4.28b-3
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], I noticed
that dacs could not be built reproducibly.

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build 2016-08-28 01:34:21.487298209 +0100
@@ -0,0 +1,65 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2016-08-19
+
+--- dacs-1.4.28b.orig/src/mkstamp
++++ dacs-1.4.28b/src/mkstamp
+@@ -18,7 +18,11 @@ version="$1"
+ 
+ echo "#define DACS_VERSION_REVID \"\$Id: \$\""
+ 
+-now=`date '+%e-%h-%Y %H:%M:%S' | sed -e "s/^ *//"`
++if test -n "$SOURCE_DATE_EPOCH"; then
++  now=`LC_ALL=C date --utc --date="@$SOURCE_DATE_EPOCH" '+%e-%h-%Y %H:%M:%S' 
| sed -e "s/^ *//"`
++else
++  now=`date '+%e-%h-%Y %H:%M:%S' | sed -e "s/^ *//"`
++fi
+ echo "#define DACS_VERSION_DATE \"Release date $now\""
+ 
+ echo "#define DACS_VERSION_RELEASE \"$version\""
+--- dacs-1.4.28b.orig/man/mkversion
++++ dacs-1.4.28b/man/mkversion
+@@ -20,7 +20,11 @@ textvfile="version.txt"
+ # We need the GNU cpp and this is the easiest way to ensure that
+ xcpp="gcc -E"
+ 
+-date=`date '+%e-%h-%Y' | sed -e "s/  / /"`
++if test -n "$SOURCE_DATE_EPOCH"; then
++  date=`LC_ALL=C date --utc --date="@$SOURCE_DATE_EPOCH" '+%e-%h-%Y' | sed -e 
"s/  / /"`
++else
++  date=`date '+%e-%h-%Y' | sed -e "s/  / /"`
++fi
+ version=`echo DACS_VERSION_RELEASE \
+             | $xcpp -P -include ../include/dacs_version.h - \
+                 | sed -e 's/"//g' | tail -1`
+--- dacs-1.4.28b.orig/src/aclcheck.c
++++ dacs-1.4.28b/src/aclcheck.c
+@@ -614,7 +614,11 @@ acl_index_xml_text(Ds *ds, Acl_index *ad
+   int i;
+   Acl_map *am;
+ 
+-  ds_asprintf(ds, "<acl_index date_created=\"%lu\">\n", ad->date_created);
++  if (getenv("SOURCE_DATE_EPOCH")) {
++      ds_asprintf(ds, "<acl_index date_created=\"%s\">\n", 
getenv("SOURCE_DATE_EPOCH"));
++  } else {
++      ds_asprintf(ds, "<acl_index date_created=\"%lu\">\n", ad->date_created);
++  }
+ 
+   for (i = 0; i < dsvec_len(ad->acl_map); i++) {
+       am = (Acl_map *) dsvec_ptr_index(ad->acl_map, i);
+--- dacs-1.4.28b.orig/man/mkindex
++++ dacs-1.4.28b/man/mkindex
+@@ -474,7 +474,12 @@ mkdirectives >> ${f}.html
+ 
+ mkdtd "../dtd-xsd" "/dtd-xsd" >> ${f}.html
+ 
+-now=`date`
++if test -n "$SOURCE_DATE_EPOCH"
++then
++  now=`LC_ALL=C date --utc --date="@$SOURCE_DATE_EPOCH"`
++else
++  now=`date`
++fi
+ echo '</div>' >> "${f}.html"
+ echo '<div id="credit-tag">' >> "${f}.html"
+ echo '<hr width="66%"><center>' >> "${f}.html"
--- a/debian/patches/series     2016-08-28 01:25:36.369737164 +0100
--- b/debian/patches/series     2016-08-28 01:26:23.442235361 +0100
@@ -2,3 +2,4 @@
 ssl_hook_Fixup
 libtool-shell
 shared-library-linkage
+reproducible-build

Reply via email to