Source: chrony
Version: 2.2.1-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Dear Maintainer,

While working on the “reproducible builds” effort [1], we have noticed
that 'chrony' could not be built reproducibly.

The attached patch uses the last changelog entry date instead of the
build date to set the ntp_era_split default parameter. Once applied,
chrony can be built reproducibly in our current experimental framework.

Regards,
Alexis Bienvenüe.

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


diff -Nru chrony-2.2.1/debian/changelog chrony-2.2.1/debian/changelog
--- chrony-2.2.1/debian/changelog	2016-04-01 14:40:35.000000000 +0200
+++ chrony-2.2.1/debian/changelog	2016-04-06 19:09:01.000000000 +0200
@@ -1,3 +1,10 @@
+chrony (2.2.1-1.0~reproducible1) unstable; urgency=medium
+
+  * Fix ntp_era_split default value from last changelog entry, to get
+    reproducible build.
+
+ -- Alexis Bienvenüe <p...@passoire.fr>  Wed, 06 Apr 2016 19:09:01 +0200
+
 chrony (2.2.1-1) unstable; urgency=medium
 
   * Import upstream versions 2.2 and 2.2.1:
diff -Nru chrony-2.2.1/debian/patches/02_uses_SOURCE_DATE_EPOCH_for_ntp_era_split.patch chrony-2.2.1/debian/patches/02_uses_SOURCE_DATE_EPOCH_for_ntp_era_split.patch
--- chrony-2.2.1/debian/patches/02_uses_SOURCE_DATE_EPOCH_for_ntp_era_split.patch	1970-01-01 01:00:00.000000000 +0100
+++ chrony-2.2.1/debian/patches/02_uses_SOURCE_DATE_EPOCH_for_ntp_era_split.patch	2016-04-06 19:08:30.000000000 +0200
@@ -0,0 +1,28 @@
+Description: Use SOURCE_DATE_EPOCH for ntp_era_split
+ Use SOURCE_DATE_EPOCH instead of current build epoch for ntp_era_split,
+ to get reproducible build.
+Author: Alexis Bienvenüe <p...@passoire.fr>
+
+--- chrony-2.2.1.orig/configure
++++ chrony-2.2.1/configure
+@@ -478,11 +478,15 @@ then
+     split_seconds=$ntp_era_split
+     split_days=0
+   else
+-    split_seconds=`date '+%s'`
+-    if [ "x$split_seconds" = "" ]; then
+-      echo "error: could not get current time, --with-ntp-era option is needed"
+-      exit 1
+-    fi
++    if [ "x$SOURCE_DATE_EPOCH" = "x" ]; then
++      split_seconds=`date '+%s'`
++      if [ "x$split_seconds" = "" ]; then
++        echo "error: could not get current time, --with-ntp-era option is needed"
++        exit 1
++      fi
++    else
++      split_seconds=$SOURCE_DATE_EPOCH
++    fi  
+     split_days=$((50 * 365))
+   fi
+ 
diff -Nru chrony-2.2.1/debian/patches/series chrony-2.2.1/debian/patches/series
--- chrony-2.2.1/debian/patches/series	2016-04-01 14:40:35.000000000 +0200
+++ chrony-2.2.1/debian/patches/series	2016-04-06 19:07:39.000000000 +0200
@@ -0,0 +1 @@
+02_uses_SOURCE_DATE_EPOCH_for_ntp_era_split.patch

Reply via email to