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

Bug#1010859: libnss-gw-name: reproducible-builds: embedded build paths in libnss_gw_name.so.*



Source: libnss-gw-name
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

The build path is embedded in /usr/lib/x86_64-linux-gnu/libnss_gw_name.so.2:

  https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/libnss-gw-name.html

  /build/1st/libnss-gw-name-0.3/libnss_gw_name.c:107
  vs.
  /build/2/libnss-gw-name-0.3/2nd/libnss_gw_name.c:107

The attached patch fixes this by updating to use debhelper compat level
13 and switching to use "dh" in debian/rules. This passes the default
CFLAGS from dpkg-buildflags, which includes the -ffile-prefix-map
argument to avoid embedding the absolute path in compiled files.


With this patch applied, libnss-gw-name should build reproducibly on
tests.reproducible-builds.org!


live well,
  vagrant
From ed3f536000aa1cd8c9d88882028abf4a6cb0b679 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Wed, 11 May 2022 16:51:25 +0000
Subject: [PATCH 2/8] Update to debhelper-compat 13 and switch to "dh".

---
 debian/compat  |  1 -
 debian/control |  2 +-
 debian/rules   | 66 ++++++--------------------------------------------
 3 files changed, 9 insertions(+), 60 deletions(-)
 delete mode 100644 debian/compat

diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 45a4fb7..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/debian/control b/debian/control
index 63cb699..3b3a844 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: admin
 Priority: extra
 Maintainer: Debian QA Group <packages@qa.debian.org>
 Build-Depends:
-  debhelper (>= 8.1.3),
+  debhelper-compat (= 13),
   pkg-config,
   libnl-3-dev,
   libnl-route-3-dev,
diff --git a/debian/rules b/debian/rules
index 14dad24..cc1b8f6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,64 +1,14 @@
 #!/usr/bin/make -f
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+%:
+	dh $@
 
-DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+override_dh_auto_build:
+	dh_auto_build -- CFLAGS="$(CFLAGS)"
 
-CFLAGS = -Wall -g -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith 
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-        CFLAGS += -O0
-else
-        CFLAGS += -O2
-endif
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-        MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-endif
+override_dh_auto_install:
+	dh_auto_install -- libprefix=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
 
-build-arch: build-arch-stamp
-build-indep:
-build: build-arch-stamp
-
-build-arch-stamp:
-	dh_testdir
-	$(MAKE) CFLAGS="$(CFLAGS)"
-	touch build-arch-stamp
-
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-arch*-stamp
-	$(MAKE) clean
+override_dh_auto_clean:
+	dh_auto_clean
 	rm -f *.o *.so *.so.*
-	dh_clean
-
-# Build architecture-independent files here.
-binary-indep: build-indep
-# We have nothing to do
-
-LIBNAME = libnss_gw_name.so.2
-
-# Build architecture-dependent files here.
-binary-arch: build-arch
-	dh_testdir
-	dh_testroot
-	dh_prep
-	dh_installdirs
-	$(MAKE) install libprefix=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) DESTDIR=$(CURDIR)/debian/libnss-gw-name
-	dh_lintian
-	dh_installchangelogs
-	dh_installdocs
-	dh_link
-	dh_strip
-	dh_makeshlibs
-	dh_shlibdeps
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build build-arch build-indep clean binary-indep binary-arch binary
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature


Reply to: