Source: cclive
Version: 0.9.3-0.1
Severity: wishlist
Tags: patch upstream
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 'cclive' could not be built reproducibly.

The attached patch honours the SOURCE_DATE_EPOCH environment
variable [2] to get a reproducible build date from the last
debian changelog entry.
Once applied, cclive can be built reproducibly in our current
experimental framework.

Regards,
Alexis Bienvenüe.

 [1]: https://wiki.debian.org/ReproducibleBuilds
 [2]: https://reproducible-builds.org/specs/source-date-epoch/




Description: Honour SOURCE_DATE_EPOCH
 Get build date from the environment variable SOURCA_DETE_EPOCH (is set)
 to make the build reproducible.
 See https://reproducible-builds.org/specs/source-date-epoch/
Author: Alexis Bienvenüe <p...@passoire.fr>

--- cclive-0.9.3.orig/configure.ac
+++ cclive-0.9.3/configure.ac
@@ -37,7 +37,9 @@ AC_DEFINE_UNQUOTED([CXXFLAGS], "$CXXFLAG
 AC_DEFINE_UNQUOTED([CXX], "$CXX", [Define to compiler])
 
 AC_PATH_PROG([DATE], [date], [no])
-AS_IF([test x"$DATE" != "xno"], [build_time=`$DATE +"%F %T %z"`])
+DATE_FMT="%F %T %z"
+SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
+build_time=$(date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT" 2>/dev/null)
 AC_DEFINE_UNQUOTED([BUILD_TIME], ["$build_time"], [We have build time])
 
 AC_PATH_PROG([A2X], [a2x], [no])

Reply via email to