Source: libmsv
Version: 1.1-2
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps fileordering
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that libmsv could not be built reproducibly.
It embeds timestamps while gzip-compressing some files, and has
randomly ordered md5sums files.

The attached patch fixes this.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/rules b/debian/rules
index 764d7cf..002a5dc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -54,7 +54,7 @@ binary-arch: checkroot
 
 	$(INSTALL_FILE) debian/copyright debian/$(package)/usr/share/doc/$(package)
 	$(INSTALL_FILE) debian/changelog debian/$(package)/usr/share/doc/$(package)/changelog.Debian
-	gzip -9f debian/$(package)/usr/share/doc/$(package)/changelog.Debian
+	gzip -9fn debian/$(package)/usr/share/doc/$(package)/changelog.Debian
 
 	mv debian/$(package)/usr/lib/*.a debian/$(devpkg)/usr/lib
 	mv debian/$(package)/usr/lib/*.so debian/$(devpkg)/usr/lib
@@ -67,15 +67,15 @@ binary-arch: checkroot
 	$(INSTALL_FILE) html/*.html html/*.png html/*.css html/dynsections.js debian/$(devpkg)/usr/share/doc/$(devpkg)/html
 	ln -s ../../../javascript/jquery/jquery.min.js debian/$(devpkg)/usr/share/doc/$(devpkg)/html/jquery.js
 	$(INSTALL_FILE) man/man3/msv*.3 debian/$(devpkg)/usr/share/man/man3
-	gzip -9f debian/$(devpkg)/usr/share/man/man3/*
+	gzip -9fn debian/$(devpkg)/usr/share/man/man3/*
 	$(INSTALL_FILE) debian/changelog debian/$(devpkg)/usr/share/doc/$(devpkg)/changelog.Debian
-	gzip -9f debian/$(devpkg)/usr/share/doc/$(devpkg)/changelog.Debian
+	gzip -9fn debian/$(devpkg)/usr/share/doc/$(devpkg)/changelog.Debian
 
 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 	strip debian/$(package)/usr/lib/*.so.*
 endif
 	$(INSTALL_SCRIPT) debian/$(package).postinst debian/$(package)/DEBIAN/postinst
-	cd debian/$(package) && find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums
+	cd debian/$(package) && find * -type f ! -regex '^DEBIAN/.*' -print0 | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
 	echo 'libmsv 1 $(package)' >debian/$(package)/DEBIAN/shlibs
 	dpkg-shlibdeps -Tdebian/$(package).substvars -dDepends debian/$(package)/usr/lib/*.so.*
 	dpkg-gencontrol -ldebian/changelog -isp -p$(package) -Tdebian/$(package).substvars -Pdebian/$(package)
@@ -85,7 +85,7 @@ endif
 		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
 	dpkg --build debian/$(package) ..
 
-	cd debian/$(devpkg) && find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums
+	cd debian/$(devpkg) && find * -type f ! -regex '^DEBIAN/.*' -print0 | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
 	dpkg-gencontrol -ldebian/changelog -isp -p$(devpkg) -Tdebian/$(devpkg).substvars -Pdebian/$(devpkg)
 	chown -R root:root debian/$(devpkg)
 	chmod -R go=rX debian/$(devpkg)

Attachment: signature.asc
Description: PGP 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