Bug#783239: kexec-tools: please make the package build reproducibly

2015-04-24 Thread Jérémy Bobbio
Source: kexec-tools
Version: 2.0.7-5.1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps

Hi!

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

The attached patch set the build date to the date of the latest
debian/changelog entry. Once applied, kexec-tools can be built
reproducibly in our current experimental framework.

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

-- 
Lunar.''`. 
lu...@debian.org: :Ⓐ  :  # apt-get install anarchism
`. `'` 
  `-   
diff -Nru kexec-tools-2.0.7/debian/changelog kexec-tools-2.0.7/debian/changelog
--- kexec-tools-2.0.7/debian/changelog	2015-04-22 12:06:28.0 +0200
+++ kexec-tools-2.0.7/debian/changelog	2015-04-24 13:47:11.0 +0200
@@ -1,3 +1,11 @@
+kexec-tools (1:2.0.7-5.1.0~reproducible1) UNRELEASED; urgency=low
+
+  * Make the package build reproducibly:
+- Add a patch to enable build date to be externally set.
+- Set the build date to the latest debian/changelog entry.
+
+ -- Jérémy Bobbio   Fri, 24 Apr 2015 13:46:29 +0200
+
 kexec-tools (1:2.0.7-5.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru kexec-tools-2.0.7/debian/patches/allow-external-build-date.patch kexec-tools-2.0.7/debian/patches/allow-external-build-date.patch
--- kexec-tools-2.0.7/debian/patches/allow-external-build-date.patch	1970-01-01 01:00:00.0 +0100
+++ kexec-tools-2.0.7/debian/patches/allow-external-build-date.patch	2015-04-24 13:48:19.0 +0200
@@ -0,0 +1,20 @@
+Description: Allow build date to be set externally
+ In order to allow the package to be built reproducibly, we can now
+ set the build date through the BUILD_DATE environment variable when
+ running ./configure.
+Author: Jérémy Bobbio 
+
+--- kexec-tools-2.0.7.orig/configure.ac
 kexec-tools-2.0.7/configure.ac
+@@ -9,7 +9,10 @@ AC_CONFIG_AUX_DIR(./config)
+ AC_CONFIG_HEADERS([include/config.h])
+ AC_LANG(C)
+ 
+-AC_DEFINE_UNQUOTED(PACKAGE_DATE, "`date '+%d %B %Y'`",
++if test "x$BUILD_DATE" = x; then
++	BUILD_DATE=`date '+%d %B %Y'`
++fi
++AC_DEFINE_UNQUOTED(PACKAGE_DATE, "$BUILD_DATE",
+ 		[Define to the release date of this package])
+ 
+ 
diff -Nru kexec-tools-2.0.7/debian/patches/series kexec-tools-2.0.7/debian/patches/series
--- kexec-tools-2.0.7/debian/patches/series	2015-04-22 12:07:00.0 +0200
+++ kexec-tools-2.0.7/debian/patches/series	2015-04-24 13:47:32.0 +0200
@@ -7,3 +7,4 @@
 const_string_warning.patch
 powerpcspe_support.patch
 fix-callback-functions-given-to-kexec_iomem_for_each_line.patch
+allow-external-build-date.patch
diff -Nru kexec-tools-2.0.7/debian/rules kexec-tools-2.0.7/debian/rules
--- kexec-tools-2.0.7/debian/rules	2014-10-10 18:29:32.0 +0200
+++ kexec-tools-2.0.7/debian/rules	2015-04-24 13:45:58.0 +0200
@@ -8,6 +8,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+BUILD_DATE = $(shell dpkg-parsechangelog -S Date | date -u +'%d %B %Y' -f -)
+export BUILD_DATE
 
 ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS
 	NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS


signature.asc
Description: Digital signature


Bug#783239: kexec-tools: please make the package build reproducibly

2016-06-04 Thread intrigeri
Hi Khalid,

Jérémy Bobbio wrote (27 Mar 2016 13:26:03 GMT) :
> The patch did not account for locale variation so kexec-tools is still
> unreproducible. An updated patch is attached.

I can confirm this, and the proposed patch looks good to me! I would
happily include it, if you don't mind, in the NMU I proposed
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752790#30 :)

What do you think?

Cheers,
--
intrigeri