Source: libstatgrab
Version: 0.91-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: usrmerge buildpath
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The example Makefile shipped in libstatgrab-dev changes depending on the
build path and if the system was build with a merged /usr
(a.k.a. usrmerge) filesystem layout.

The attached patches fix these issues, though it might be worth
considering dropping the example Makefile from the package entirely; the
end-user would have to regenerate it themselves in order for it to be
functional.


live well,
  vagrant

From 9e8f7ff6e357ca9d97d7be3d4a1087e06d9bd61e Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Thu, 28 May 2020 17:43:55 +0000
Subject: [PATCH 1/2] Fix varying paths in example Makefile.

Pass values for various binaries to configure to ensure reproducible
builds when built on a usrmerged system.
---
 debian/rules | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/debian/rules b/debian/rules
index 3cc4d57..dad932a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,3 +5,14 @@
 
 %:
 	dh $@ --with autoreconf
+
+override_dh_auto_configure:
+	# Ensure consistant paths for binaries to ensure reproducible
+	# builds on usrmerge vs. non-usrmerge systems.
+	dh_auto_configure -- \
+		GREP=/bin/grep \
+		EGREP="/bin/grep -E" \
+		FGREP="/bin/grep -F" \
+		MKDIR_P="/bin/mkdir -p" \
+		SED=/bin/sed \
+		SHELL=/bin/sh
-- 
2.20.1

From 549a33130543cd93a83d50f285dda208a7896408 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Thu, 28 May 2020 17:46:48 +0000
Subject: [PATCH 2/2] Remove build paths from example Makefile to ensure
 reproducible builds.

---
 debian/rules | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/debian/rules b/debian/rules
index dad932a..dbdb749 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,3 +16,13 @@ override_dh_auto_configure:
 		MKDIR_P="/bin/mkdir -p" \
 		SED=/bin/sed \
 		SHELL=/bin/sh
+
+override_dh_install:
+	# Clean up embedded build paths in order to ensure reproducible builds.
+	sed -i -e "s,-fdebug-prefix-map=$(CURDIR)=\.,,g" \
+		-e "s,-ffile-prefix-map=$(CURDIR)=\.,,g" \
+		-e "s,abs_.*$(CURDIR).*,,g" \
+		-e "s,$(CURDIR).*missing --run,,g" \
+		-e "s,$(CURDIR),./,g" \
+		$(CURDIR)/examples/Makefile
+	dh_install
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature

Reply via email to