Source: cdebootstrap
Version: 0.6.4
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi,

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

The attached patch removes timestamps from the build system. Once
applied, cdebootstrap 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 cdebootstrap.orig/cdebootstrap-0.6.4/debian/rules 
cdebootstrap/cdebootstrap-0.6.4/debian/rules
--- cdebootstrap.orig/cdebootstrap-0.6.4/debian/rules   2015-02-11 
22:52:37.057717891 +0000
+++ cdebootstrap/cdebootstrap-0.6.4/debian/rules        2015-02-12 
02:30:03.394302529 +0000
@@ -7,6 +7,7 @@
 include /usr/share/dpkg/default.mk
 
 VERSION  := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\),\1,p')
+BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
 
 configure:
        autoreconf -i
@@ -86,7 +87,7 @@
        dh_prep
        dh_installdirs
 
-       $(MAKE) -C build-deb install DESTDIR=$(CURDIR)/debian/cdebootstrap
+       $(MAKE) -C build-deb install DESTDIR=$(CURDIR)/debian/cdebootstrap 
BUILD_DATE="$(BUILD_DATE)"
 
        $(MAKE) -C build-static install 
DESTDIR=$(CURDIR)/debian/cdebootstrap-static
        mv debian/cdebootstrap-static/usr/bin/cdebootstrap 
debian/cdebootstrap-static/usr/bin/cdebootstrap-static
@@ -94,7 +95,7 @@
 
        $(MAKE) -C build-tar install DESTDIR=$(CURDIR)/debian/tmp
        strip --remove-section=.comment --remove-section=.note 
debian/tmp/usr/bin/cdebootstrap
-       tar -C debian/tmp/usr/bin -czf 
debian/tmp/cdebootstrap_$(VERSION)_$(DEB_HOST_ARCH).tar.gz .
+       GZIP=-9n tar -C debian/tmp/usr/bin --mtime="$(BUILD_DATE)" -czf 
debian/tmp/cdebootstrap_$(VERSION)_$(DEB_HOST_ARCH).tar.gz .
        mkdir -p debian/cdebootstrap-static/usr/lib/cdebootstrap
        cp debian/tmp/cdebootstrap_$(VERSION)_$(DEB_HOST_ARCH).tar.gz 
debian/cdebootstrap-static/usr/lib/cdebootstrap
 
diff -urNad cdebootstrap.orig/cdebootstrap-0.6.4/helper/Makefile.am 
cdebootstrap/cdebootstrap-0.6.4/helper/Makefile.am
--- cdebootstrap.orig/cdebootstrap-0.6.4/helper/Makefile.am     2015-02-11 
22:52:37.061718068 +0000
+++ cdebootstrap/cdebootstrap-0.6.4/helper/Makefile.am  2015-02-12 
02:36:09.415943735 +0000
@@ -22,6 +22,8 @@
 
 temp-%:
        $(MAKE) -C $(PACKAGE) package DESTDIR=$(CURDIR)/temp-$(PACKAGE)
+       find "$(CURDIR)/temp-$(PACKAGE)" -print0 | \
+               xargs -0r touch --date="$(BUILD_DATE)"
 
 root-%:
        dpkg-deb -Zgzip --build temp-$(PACKAGE) $(PACKAGE).deb
diff -urNad cdebootstrap.orig/cdebootstrap-0.6.4/helper/Makefile.in 
cdebootstrap/cdebootstrap-0.6.4/helper/Makefile.in
--- cdebootstrap.orig/cdebootstrap-0.6.4/helper/Makefile.in     2015-02-11 
22:52:37.061718068 +0000
+++ cdebootstrap/cdebootstrap-0.6.4/helper/Makefile.in  2015-02-12 
02:35:35.802681843 +0000
@@ -604,6 +604,8 @@
 
 root-%:
        dpkg-deb -Zgzip --build temp-$(PACKAGE) $(PACKAGE).deb
+       find "$(CURDIR)/temp-$(PACKAGE)" -print0 | \
+               xargs -0r touch --date="$(BUILD_DATE)"
 
 clean-local:
        rm -rf $(foreach package,$(packages),temp-$(package))
_______________________________________________
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