Source: flex
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: buildpaths
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Well, this is a bit of a re-run: Bug#949343: flex: Embeds build paths in
example Makefiles

But in my proposed fix for that version, I neglected to test only
building arch:all packages, which triggered: #961778 flex: binary-all
FTBFS

This time, I'm proposing a much simpler fix; just remove the generated
Makefiles, but only remove them when ... they are actually present!
(e.g. arch:any build vs. arch:all build)

I think this is a better approach than sanitizing the Makefile, since
the Makefile.am is also shipped, and a person who wanted to build the
examples would probably need to regenerate the Makefile anyways.

Patch attached, tested with arch:all only, arch:any only and
arch:all+any builds.


live well,
  vagrant
From 4b9384cc7b73f984507c75f15f293982896135a4 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Wed, 18 Nov 2020 04:04:02 +0000
Subject: [PATCH] debian/rules: Remove example autogenerated Makefiles which
 contain build paths.

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

diff --git a/debian/rules b/debian/rules
index d0d5597..31a4c72 100755
--- a/debian/rules
+++ b/debian/rules
@@ -91,6 +91,15 @@ ifneq (,$(filter flex-doc, $(shell dh_listpackages)))
            debian/flex-doc/usr/share/doc/flex-doc/
 endif
 
+override_dh_installexamples:
+	dh_installexamples
+	# Remove autogenerated Makefiles which contain embedded build
+	# paths in order to ensure reproducible builds.
+	test ! -f debian/flex/usr/share/doc/flex/examples/fastwc/Makefile || \
+		rm -f debian/flex/usr/share/doc/flex/examples/fastwc/Makefile
+	test ! -f debian/flex/usr/share/doc/flex/examples/manual/Makefile || \
+		rm -f debian/flex/usr/share/doc/flex/examples/manual/Makefile
+
 override_dh_auto_build:
 	dh_auto_build
 ifneq (,$(filter flex-doc, $(shell dh_listpackages)))
-- 
2.29.2

Attachment: signature.asc
Description: PGP signature

Reply via email to