Source: aft Version: 2:5.098-2 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: timestamps randomness X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org
Hi, While working on the "reproducible builds" effort [1], we have noticed that aft could not be built reproducibly. The attached patch removes timestamps and randomness from the build system. Once applied, aft can be built reproducibly in our current experimental framework. [1]: https://wiki.debian.org/ReproducibleBuilds Regards, -- ,''`. : :' : Chris Lamb `. `'` la...@debian.org / chris-lamb.co.uk `-
diff -urNad aft.orig/aft-5.098/compile.pl aft/aft-5.098/compile.pl --- aft.orig/aft-5.098/compile.pl 2015-02-10 08:59:25.237512275 +0000 +++ aft/aft-5.098/compile.pl 2015-02-10 09:05:25.093653131 +0000 @@ -20,7 +20,7 @@ my $postfilter; my $prefilter; -$date = scalar localtime; +$date = $ENV{'BUILD_DATE'} || scalar localtime; (@ARGV == 0) && do { print (STDERR "Usage: aft-compile element_file.dat \n"); @@ -129,13 +129,13 @@ $interpolate = ($element{"interpolate"} =~ 'no') ? 0 : 1; print "\t\%pragma_postvar = (\n"; -foreach $item (keys %postvar) { +foreach $item (sort keys %postvar) { print "\t\t'$item' =>\t '$postvar{$item}',\n"; } print "\t);\n"; print "\t\%elem = (\n"; -foreach $item (keys %element) { +foreach $item (sort keys %element) { if ($element{$item} =~ /^\<Undefined/) { print (STDERR "Undefined element: [$item]\n"); } diff -urNad aft.orig/aft-5.098/debian/rules aft/aft-5.098/debian/rules --- aft.orig/aft-5.098/debian/rules 2015-02-10 08:59:25.237512275 +0000 +++ aft/aft-5.098/debian/rules 2015-02-10 09:05:58.551154041 +0000 @@ -3,6 +3,8 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date) + config.status: configure dh_testdir ./configure --prefix=/usr @@ -11,7 +13,7 @@ build-stamp: config.status dh_testdir - $(MAKE) + $(MAKE) BUILD_DATE="$(BUILD_DATE)" touch build-stamp clean: