Re: [Reproducible-builds] Bug#783515: memtest86+: please make package build reproducibly

2015-04-27 Thread Jérémy Bobbio
Jérémy Bobbio:
> The attached patch […]

For real, this time.

-- 
Lunar.''`. 
lu...@debian.org: :Ⓐ  :  # apt-get install anarchism
`. `'` 
  `-   
diff -Nru memtest86+-5.01/debian/changelog memtest86+-5.01/debian/changelog
--- memtest86+-5.01/debian/changelog	2014-09-10 19:58:11.0 +
+++ memtest86+-5.01/debian/changelog	2015-04-27 16:53:40.0 +
@@ -1,3 +1,12 @@
+memtest86+ (5.01-2.0~reproducible1) UNRELEASED; urgency=low
+
+  * Make the package build reproducibly:
+- Add a patch to make ISO image reproducible.
+- Set the build date to the latest debian/changelog entry in
+  debian/rules.
+
+ -- Jérémy Bobbio   Sun, 26 Apr 2015 22:57:52 +
+
 memtest86+ (5.01-2) unstable; urgency=medium
 
   * Build -O0 to workaround what is apparently a gcc 4.9 optimisation bug,
diff -Nru memtest86+-5.01/debian/patches/make-iso-reproducible memtest86+-5.01/debian/patches/make-iso-reproducible
--- memtest86+-5.01/debian/patches/make-iso-reproducible	1970-01-01 00:00:00.0 +
+++ memtest86+-5.01/debian/patches/make-iso-reproducible	2015-04-27 16:52:57.0 +
@@ -0,0 +1,34 @@
+Description: make ISO image reproducible
+ To enable the ISO image to be built reproducibly, we need to allow
+ the build date to be set externally. This will cap the modification time
+ of the embedded files, and set the image creation date.
+ .
+ The timezone is also set to UTC to avoid variations from one build
+ environment to another.
+ .
+ This requires a version of genisoimage supporting the -creation-date flag.
+Author: Jérémy Bobbio 
+
+
+Index: memtest86+-5.01/makeiso.sh
+===
+--- memtest86+-5.01.orig/makeiso.sh
 memtest86+-5.01/makeiso.sh
+@@ -37,7 +37,16 @@ cd cd
+ echo -e "There is nothing to do here\r\r\nMemtest86+ is located on the bootsector of this CD\r\r\n" > README.TXT
+ echo -e "Just boot from this CD and Memtest86+ will launch" >> README.TXT
+ 
+-genisoimage -A "MKISOFS 1.1.2" -p "Memtest86+ 5.01" -publisher "Samuel D. " -b boot/memtest.img -c boot/boot.catalog -V "MT501" -o memtest.iso .
++if [ "$BUILD_DATE" ]; then
++	if genisoimage -help 2>&1 | grep -q -- '-creation-date'; then
++		find . -newermt "$BUILD_DATE" -print0 |
++			xargs -0r touch --no-dereference --date="$BUILD_DATE"
++		EXTRA_OPTS="-creation-date $(date -u +'%s' --date="$BUILD_DATE")"
++	else
++		echo "genisoimage does not support -creation-date. Ignoring BUILD_DATE."
++	fi
++fi
++TZ=UTC genisoimage $EXTRA_OPTS -A "MKISOFS 1.1.2" -p "Memtest86+ 5.01" -publisher "Samuel D. " -b boot/memtest.img -c boot/boot.catalog -V "MT501" -o memtest.iso .
+ mv memtest.iso ../mt501.iso
+ cd ..
+ rm -rf cd
diff -Nru memtest86+-5.01/debian/patches/series memtest86+-5.01/debian/patches/series
--- memtest86+-5.01/debian/patches/series	2014-09-10 19:53:13.0 +
+++ memtest86+-5.01/debian/patches/series	2015-04-27 16:46:39.0 +
@@ -2,3 +2,4 @@
 multiboot
 memtest86+-5.01-O0.patch
 memtest86+-5.01-array-size.patch
+make-iso-reproducible
diff -Nru memtest86+-5.01/debian/rules memtest86+-5.01/debian/rules
--- memtest86+-5.01/debian/rules	2014-06-27 22:01:24.0 +
+++ memtest86+-5.01/debian/rules	2015-04-26 23:07:07.0 +
@@ -4,6 +4,10 @@
 
 PACKAGE=memtest86+
 
+# ensure reproducible ISO9660 image
+BUILD_DATE=$(shell dpkg-parsechangelog -S Date)
+export BUILD_DATE
+
 build: build-stamp
 build-stamp:
 	dh_testdir


signature.asc
Description: Digital signature
___
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

[Reproducible-builds] Bug#783515: memtest86+: please make package build reproducibly

2015-04-27 Thread Jérémy Bobbio
Source: memtest86+
Version: 5.01-2
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
Control: block -1 by 783513

Hi!

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

The attached patch set the file and ISO image creation date.
With this patch and the one submitted in #783513, memtest86+ can then be
built reproducibly in our current experimental framework.

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

-- 
Lunar.''`. 
lu...@debian.org: :Ⓐ  :  # apt-get install anarchism
`. `'` 
  `-   


signature.asc
Description: Digital signature
___
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds