[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#916829: libapr1-dev is broken on unmerged /usr



Control: tags 916829 patch
Control: user reproducible-builds@lists.alioth.debian.org
Control: usertags 916829 usrmerge buildpath

On 2018-12-19, Michael Biebl wrote:
> This issue was also detected by reproducible-builds.
>
> See
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/apr.html
> or specifically
> https://tests.reproducible-builds.org/debian/dbdtxt/unstable/amd64/apr_1.6.5-1.diffoscope.txt.gz
>
> Various tools found in PATH during build time are embedded into
> /usr/bin/apr-1-config and /usr/share/apr-1.0/build/libtool

The attached patches fix the PATH issues caused by building on usrmerge
systems as well as making the build reproducible even if built in
different build paths.


live well,
  vagrant

From c4f0b00d94a4694e428e504f02e811a390c9a317 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Wed, 19 Aug 2020 06:12:48 +0000
Subject: [PATCH 1/3] debian/rules: Pass SED, GREP, EGREP And FGREP to
 configure to enable reproducible builds.

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

diff --git a/debian/rules b/debian/rules
index 8ecec7b..6683218 100755
--- a/debian/rules
+++ b/debian/rules
@@ -73,6 +73,13 @@ ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
   endif
 endif
 
+# Set several variables to make build reproducible even when built on
+# usrmerge system
+CONFFLAGS += SED=/bin/sed
+CONFFLAGS += GREP=/bin/grep
+CONFFLAGS += EGREP="/bin/grep -E"
+CONFFLAGS += FGREP="/bin/grep -F"
+
 override_dh_autoreconf:
 	LC_ALL=C dh_autoreconf ./buildconf
 
-- 
2.20.1

From 2d95d59bde51b5a5d10be429e1e9b137eeb25614 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Wed, 19 Aug 2020 07:03:34 +0000
Subject: [PATCH 2/3] debian/rules: Ensure consistant value for libtool
 lt_truncate_bin in override_dh_auto_install.

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

diff --git a/debian/rules b/debian/rules
index 6683218..39ffafd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -149,6 +149,8 @@ override_dh_auto_install:
 	perl -p -i -e "s,^dependency_libs=.*,dependency_libs=''," debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libapr-1.la
 	# Remove hostname to make build reproducible
 	perl -p -i -e 's/Libtool was configured on host.*//' debian/tmp/usr/share/apr-1.0/build/libtool
+	# Consistantly use /bin/dd to make build reproducible
+	perl -p -i -e 's/lt_truncate_bin=.*.bin.dd /lt_truncate_bin=\/bin\/dd /' debian/tmp/usr/share/apr-1.0/build/libtool
 	if ! head -n 1 debian/tmp/usr/share/apr-1.0/build/libtool | grep -q /bin/bash ; then \
 		echo ERROR: The built libtool uses /bin/sh instead of /bin/bash ; \
 		exit 1 ; \
-- 
2.20.1

From 597db040a66926fd8001261c2cf96715f4e1bf6e Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Wed, 19 Aug 2020 08:31:41 +0000
Subject: [PATCH 3/3] debian/rules: Strip out build directory from libtool,
 apr-1-config and apr_rules.mk

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

diff --git a/debian/rules b/debian/rules
index 39ffafd..4ae3dc6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -151,6 +151,10 @@ override_dh_auto_install:
 	perl -p -i -e 's/Libtool was configured on host.*//' debian/tmp/usr/share/apr-1.0/build/libtool
 	# Consistantly use /bin/dd to make build reproducible
 	perl -p -i -e 's/lt_truncate_bin=.*.bin.dd /lt_truncate_bin=\/bin\/dd /' debian/tmp/usr/share/apr-1.0/build/libtool
+	# Replace variable build path with BUILDDIR
+	perl -p -i -e "s,$(CURDIR),BUILDDIR/," debian/tmp/usr/bin/apr-1-config
+	perl -p -i -e "s,$(CURDIR),BUILDDIR/," debian/tmp/usr/share/apr-1.0/build/apr_rules.mk
+	perl -p -i -e "s,$(CURDIR),BUILDDIR/," debian/tmp/usr/share/apr-1.0/build/libtool
 	if ! head -n 1 debian/tmp/usr/share/apr-1.0/build/libtool | grep -q /bin/bash ; then \
 		echo ERROR: The built libtool uses /bin/sh instead of /bin/bash ; \
 		exit 1 ; \
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature


Reply to: