Source: lordsawar
Version: 0.3.0-2
Severity: wishlist
Tags: patch upstream
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps username umask
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that lordsawar could not be built reproducibly.
The gama data archives, which are just tarballs, have files with the
current time, the build user and varying permissions (depending on
umask).

The attached patch fixes this.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/reproducible-build.patch b/debian/patches/reproducible-build.patch
new file mode 100644
index 0000000..7f4bafb
--- /dev/null
+++ b/debian/patches/reproducible-build.patch
@@ -0,0 +1,18 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Make tarball reproducible
+ - sort file order
+ - clamp mtime at $SOURCE_DATE_EPOCH
+ - set owner/group to root
+ - fix permissions
+
+--- a/create-lw-file
++++ b/create-lw-file
+@@ -13,7 +13,7 @@
+   for f in $files; do
+           tmpfiles="$tmpfiles `basename $f`"
+   done
+-  tar -cvf $tarball $tmpfiles
++  tar -cvf $tarball $tmpfiles --sort=name --clamp-mtime --mtime="@${SOURCE_DATE_EPOCH:-$(date +%s)}" --mode=go=rX,u+rw,a-s --owner=root --group=root --numeric-owner
+   cd $origdir
+   cp -f $tmpdir/$tarball $1
+   rm -f $tmpdir/*
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..55077d0
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+reproducible-build.patch

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