Source: manpages
Version: 3.74-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps randomness

Hi!

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

The attached patches removes timestamps from gzip headers and ensure a
stable order in the copyright file. Once applied, manpages can be built
reproducibly with our current experimental framework.

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

-- 
Lunar                                .''`. 
lu...@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
From f1250e9b93ae8141fd455522d37b43886b5363e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobibo?= <lu...@debian.org>
Date: Thu, 8 Jan 2015 12:14:06 +0100
Subject: [PATCH 1/2] Stop recording timestamps in gzip headers

These timestamps prevent the package from building reproducibly.
---
 debian/inst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/inst b/debian/inst
index 166f1e5..1d2f60e 100644
--- a/debian/inst
+++ b/debian/inst
@@ -7,7 +7,7 @@ install -d -m 755 licenses
 install -d -m 755 debian/manpages/usr/share/man/man{1,2,3,4,5,6,7,8}
 install -p -m 644 man2/intro.2 debian/manpages/usr/share/man/man2
 install -p -m 644 man3/intro.3 debian/manpages/usr/share/man/man3
-gzip -9 debian/manpages/usr/share/man/man{2,3}/*
+gzip -9n debian/manpages/usr/share/man/man{2,3}/*
 
 # Installing manpages files
 for i in man[145678]; do
@@ -52,7 +52,7 @@ for i in man[145678]; do
 		esac
 		echo -n " "
 	done
-	gzip -9 debian/manpages/usr/share/man/$i/*.?
+	gzip -9n debian/manpages/usr/share/man/$i/*.?
 	echo
 done
 
@@ -104,7 +104,7 @@ for i in man[23]; do
 		esac
 		echo -n " "
 	done
-	gzip -9 debian/manpages-dev/usr/share/man/$i/*.?
+	gzip -9n debian/manpages-dev/usr/share/man/$i/*.?
 	echo
 done
 
-- 
2.1.4

From c22bee93063848c6c1208697024d644599b60c1b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobibo?= <lu...@debian.org>
Date: Thu, 8 Jan 2015 12:17:20 +0100
Subject: [PATCH 2/2] Ensure licenses are in a stable order in copyright file

Perl hashes are sorted differently at each run. To make the package
build reproducibly, we sort the licenses in order to get a stable
order.
---
 debian/make-copyright | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/make-copyright b/debian/make-copyright
index 656f88e..c152aaa 100644
--- a/debian/make-copyright
+++ b/debian/make-copyright
@@ -149,7 +149,7 @@ foreach my $file (@files) {
 	    $license = $exception{$file};
 	} elsif (!exists $licensetext{$file}) {
 	    $license = '';
-	    foreach $l (keys %licenses) {
+	    foreach $l (sort keys %licenses) {
 		if ($blurb =~ /$licenses{$l}/) {
 		    $license = $l;
 		    last;
@@ -177,7 +177,7 @@ if (-r $config{template}) {
 }
 print OUT "\n";
 
-foreach $l (keys %licenses) {
+foreach $l (sort keys %licenses) {
     if (exists $manpages{$l}) {
 	print OUT "=" x $config{width} . "\n\n";
 	print OUT "The following license covers these manpages:\n\n";
@@ -194,7 +194,7 @@ foreach $l (keys %licenses) {
     }
 }
 
-foreach $l (keys %licensetext) {
+foreach $l (sort keys %licensetext) {
     print OUT "=" x $config{width} . "\n\n";
     print OUT "The following license covers these manpages:\n\n";
     $l =~ /(.*)\.(\d)/;
-- 
2.1.4

Attachment: 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

Reply via email to