🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.devel
Article #324

Re: Interrogate PyBuild for build directory of *only* the current Python interpreter version

#324
From: Ben Finney
Date: Fri, 06 Nov 2026 04:30
84 lines
5288 bytes
Howdy all,

What is (the?) recommended way to have DebHelper build, from one source
package, a collection of binary packages including a documentation
binary package, all of which have the “main package” for their
documentation?

Debian Policy §12.3 says, of “Additional documentation”:

    If the documentation is packaged separately, as package-doc for
    example […] installing the documentation into the documentation
    directory of the main package is encouraged since it is independent
    of the packaging method and will be easier for users to find.

For a hypothetical source package ‘foo’ that builds binary packages:

* ‘foo’, that installs a program of that name
* ‘libfoo42’, that installs the run-time library
* ‘foo-doc’, that installs the user documentation

that passage of Policy §12.3 recommends one directory for the “main
package”, ‘/usr/share/doc/foo/’, and the user documentation from
‘foo-doc’ should be installed to there (maybe to
‘/usr/share/doc/foo/html/’).

The examples I'm dealing with often use Sphinx to build documentation
from source, if that matters; but I assume this should be relatively
standardised no matter what builds the documentation.

How do we then best convince DebHelper to make the “main package”
documentation directory when needed, construct ‘foo-doc’ so that it
installs that documentation to ‘/usr/share/doc/foo/…’, and symlink the
various binary package documentation directories to the main package
documentation directory?

In a recent discussion, this came up:

Stuart Prescott <stuart@debian.org> writes:

> […] I'd also not do that dh_link dance until I was installing things
> from the staging output into the packages, but that's a matter of
> taste.

Stuart refers to this dance in the ‘towncrier’ packaging, in
‘debian/rules’:

=====
[…]
PACKAGE_NAME = towncrier
[…]
LIBRARY_PACKAGE_NAME = python3-${MAIN_PYTHON_PACKAGE}
DOC_PACKAGE_NAME = ${PACKAGE_NAME}-doc
[…]

override_dh_auto_build: ${private_bin_dir}
	dh_link -p "${LIBRARY_PACKAGE_NAME}" \
		usr/share/doc/"${LIBRARY_PACKAGE_NAME}" \
		usr/share/doc/"${PACKAGE_NAME}"
	dh_link -p "${DOC_PACKAGE_NAME}" \
		usr/share/doc/"${DOC_PACKAGE_NAME}" \
		usr/share/doc/"${PACKAGE_NAME}"
	dh_auto_build
[…]
=====

and for completeness, here is the functional content of
‘debian/towncrier-doc.install’:

=====
docs/_build/html/            usr/share/doc/towncrier/
=====

This certainly is more complex than I want it to be. It's the latest
result of beating my forehead against DebHelper magic trying to convince
it to put things where I want them.

Am I missing something; can DebHelper do this automatically without
these manual ‘dh_link’ invocations?

-- 
 \       “The Vatican is not a state.… a state must have people. There |
  `\    are no Vaticanians.… No-one gets born in the Vatican except by |
_o__)        an unfortunate accident.” —Geoffrey Robertson, 2010-09-18 |
Ben Finney
Technical Details
Message-ID: <NWjKp-a7n0-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <NWg09-a5eH-3@gated-at.bofh.it> <NWibD-a6mp-1@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Ben Finney <bignose@debian.org>
Newsgroups: linux.debian.devel
Subject: Re: Interrogate PyBuild for build directory of *only* the current Python interpreter version
Date: Fri, 06 Nov 2026 05:30:01 +0100
Message-ID: <NWjKp-a7n0-3@gated-at.bofh.it>
References: <NWg09-a5eH-3@gated-at.bofh.it> <NWibD-a6mp-1@gated-at.bofh.it>
X-Original-To: debian-devel@lists.debian.org
X-Mailbox-Line: From debian-devel-request@lists.debian.org  Fri Nov  6 04:28:34 2026
Old-Return-Path: <glddg-debian-devel-5@m.gmane-mx.org>
X-Amavis-Spam-Status: No, score=-1.75 tagged_above=-10000 required=5.3
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1,
 HEADER_FROM_DIFFERENT_DOMAINS=0.25] autolearn=no autolearn_force=no
X-Policyd-Weight: using cached result; rate:hard: -4.6
X-Greylist: delayed 327 seconds by postgrey-1.37 at bendel; Fri, 06 Nov 2026 04:28:22 UTC
X-Injected-Via-Gmane: http://gmane.org/
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:xvSbxF8b7a84cPccMR2t+ba5Smw=
X-Public-Key-ID: 0xAC128405
X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35  4855 B8B2 4C06 AC12 8405
X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From: Ben Finney <bignose+hates-spam@benfinney.id.au>
X-Mailing-List: <debian-devel@lists.debian.org> archive/latest/373027
List-ID: <debian-devel.lists.debian.org>
List-URL: <https://lists.debian.org/debian-devel/>
List-Archive: https://lists.debian.org/msgid-search/87fqxepp0r.fsf@benfinney.id.au
Approved: robomod@news.nic.it
Lines: 84
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Fri, 06 Nov 2026 15:22:44 +1100
X-Original-Message-ID: <87fqxepp0r.fsf@benfinney.id.au>
X-Original-References: <87se1eq0hm.fsf@benfinney.id.au>
	<75e9d39b-a45b-46f0-a33b-c3ac9c9f910f@debian.org>