Package: src:coreutils
Version: 9.4-2
Tags: patch

Dear coreutils maintainers,

the coreutils package is affected by three issues related to the <nodoc> profile:

1. Even when the <nodoc> build profile is used, `texinfo` remains a
required build dependency.

2. Certain documentation files are also kept in the package because they are not handled by dh_installdocs but via ad-hoc commands in d/rules.

3. coreutils Build-Depends on `groff` but `groff` is not used by the build process.

Please find attached three patches that fix all these issues and add support for the <nodoc> build profile.

Regards,

--
Gioele Barabucci
From 0a040804acf78e6e2fbe63610a6ff8b3aad5d880 Mon Sep 17 00:00:00 2001
From: Gioele Barabucci <gio...@svario.it>
Date: Wed, 29 Nov 2023 22:49:53 +0100
Subject: [PATCH 1/3] d/control: Removed unused groff dependency

groff is not used during the build process
---
 debian/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index d4f4a69a..67bd9aaf 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Maintainer: Michael Stone <mst...@debian.org>
 Section: utils
 Priority: required
 Standards-Version: 4.5.0
-Build-Depends: gettext (>= 0.10.37), debhelper-compat (= 13), texinfo (>= 4.2), groff, libattr1-dev [linux-any], libacl1-dev [linux-any], libselinux1-dev (>= 1.32) [linux-any], gperf, bison, libgmp3-dev, libssl-dev [linux-amd64]
+Build-Depends: gettext (>= 0.10.37), debhelper-compat (= 13), texinfo (>= 4.2), libattr1-dev [linux-any], libacl1-dev [linux-any], libselinux1-dev (>= 1.32) [linux-any], gperf, bison, libgmp3-dev, libssl-dev [linux-amd64]
 
 Package: coreutils
 Architecture: any
-- 
2.42.0

From 529dadbe67366cf5b92c5cb5ea87bc739189bb3a Mon Sep 17 00:00:00 2001
From: Gioele Barabucci <gio...@svario.it>
Date: Wed, 29 Nov 2023 22:49:55 +0100
Subject: [PATCH 2/3] d/coreutils.docs: Install extra documentation using
 dh_installdocs

---
 debian/coreutils.docs | 5 +++++
 debian/rules          | 7 -------
 2 files changed, 5 insertions(+), 7 deletions(-)
 create mode 100644 debian/coreutils.docs

diff --git a/debian/coreutils.docs b/debian/coreutils.docs
new file mode 100644
index 00000000..04303916
--- /dev/null
+++ b/debian/coreutils.docs
@@ -0,0 +1,5 @@
+AUTHORS
+NEWS
+README
+THANKS
+TODO
diff --git a/debian/rules b/debian/rules
index 3e14f8e7..619f2e4e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -66,10 +66,3 @@ endif
 
 	# some build environments will leave a dangling info dir
 	rm -f $(d)/usr/share/info/dir
-
-	cp AUTHORS \
- 		NEWS README \
- 		THANKS \
- 		TODO \
- 		$(d)/usr/share/doc/coreutils
-
-- 
2.42.0

From 5c4f7cd755c2a0acd1504619e7912acee418d284 Mon Sep 17 00:00:00 2001
From: Gioele Barabucci <gio...@svario.it>
Date: Wed, 29 Nov 2023 22:49:55 +0100
Subject: [PATCH 3/3] Support <nodoc> build profile

---
 debian/control |  2 +-
 debian/rules   | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 67bd9aaf..2e408e2b 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Maintainer: Michael Stone <mst...@debian.org>
 Section: utils
 Priority: required
 Standards-Version: 4.5.0
-Build-Depends: gettext (>= 0.10.37), debhelper-compat (= 13), texinfo (>= 4.2), libattr1-dev [linux-any], libacl1-dev [linux-any], libselinux1-dev (>= 1.32) [linux-any], gperf, bison, libgmp3-dev, libssl-dev [linux-amd64]
+Build-Depends: gettext (>= 0.10.37), debhelper-compat (= 13), texinfo (>= 4.2) <!nodoc>, libattr1-dev [linux-any], libacl1-dev [linux-any], libselinux1-dev (>= 1.32) [linux-any], gperf, bison, libgmp3-dev, libssl-dev [linux-amd64]
 
 Package: coreutils
 Architecture: any
diff --git a/debian/rules b/debian/rules
index 619f2e4e..9e94f0a5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,6 +13,10 @@ ifeq ($(DEB_HOST_ARCH_CPU),sh4)
   DEB_CFLAGS_MAINT_APPEND += -mieee
 endif
 
+ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
+  export MAKEINFO = true
+endif
+
 BIN_PROGS = cat chgrp chmod chown cp date dd df dir echo false ln ls mkdir \
 	mknod mv pwd readlink rm rmdir vdir sleep stty sync touch true uname \
 	mktemp
@@ -66,3 +70,9 @@ endif
 
 	# some build environments will leave a dangling info dir
 	rm -f $(d)/usr/share/info/dir
+
+ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
+	# Remove info files and manual pages if building with <nodoc>
+	rm -rf $(d)/usr/share/info/
+	rm -rf $(d)/usr/share/man/
+endif
-- 
2.42.0

Reply via email to