Source: munin-c Version: 0.0.9-1 Severity: wishlist Tags: upstream patch User: reproducible-bui...@lists.alioth.debian.org Usertags: buildpath
Hi! While working on the “reproducible builds” effort [1], we have noticed that munin-c could not be built reproducibly. Specifically, ./getversion outputs "unknown" if the last component of the build path is not of the form munin-c-* (as with 'sbuild --build-path /tmp/foobar'). Patch attached. Cheers, Daniel [1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/reproducible-build.diff b/debian/patches/reproducible-build.diff index e69de29..2cb08b9 100644 --- a/debian/patches/reproducible-build.diff +++ b/debian/patches/reproducible-build.diff @@ -0,0 +1,25 @@ +Description: Make the build reproducible + Make the build independent of the value of $(pwd). +Author: Daniel Shahaf <danie...@apache.org> +Bug-Debian: https://bugs.debian.org/-1 +Last-Update: 2016-11-23 + +--- a/getversion ++++ b/getversion +@@ -64,10 +64,16 @@ + basename $(pwd) | grep -e '^munin-c' | cut -c9- + } + ++generate_version_string_from_packaging() { ++ dpkg-parsechangelog -SVersion ++} ++ + if [ -s "RELEASE" ]; then + cat RELEASE + elif [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then + generate_version_string ++elif [ ! -z "$(generate_version_string_from_packaging 2>/dev/null)" ]; then ++ generate_version_string_from_packaging + elif [ ! -z "$(generate_version_string_from_dir)" ]; then + generate_version_string_from_dir + else diff --git a/debian/patches/series b/debian/patches/series index e69de29..f64d497 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -0,0 +1 @@ +reproducible-build.diff