On Fri, Aug 10, 2018 at 06:02:14AM +1000, Ben Finney wrote:
> Chris Lamb <lamby@debian.org> writes:
>
> > * You should probably avoid building the documentation too if the
> > nodocs build profile is enabled.
>
> For packages from PyPI which have documentation detectable by
> ‘dh_sphinxdoc’, does this (avoid building the documentation if the
> “nodocs” build profile is enabled) just work by default? Or do we need
> some specific change to the Debian package?
I also wonder about this :-) Unfortunately, in the case of Elpy,
dh_sphinxdoc does not find the documentation, and specifying a subdir
only limits the search for documentation to that dir.:
dh_sphinxdoc -O--buildsystem=pybuild
dh_sphinxdoc: Sphinx documentation not found
> Is there generic Debian package maintainer advice that can be given –
> specific things to put in ‘/debian/rules’, etc. – to let “nodocs” work
> as designed?
Yes, this would be very much appreciated!
I followed a Debian Python Team wiki page on the topic and am
currently using the following in debian/rules:
override_dh_auto_build:
dh_auto_build
PYTHONPATH=. sphinx-build -N -bman docs/ build/man # Manpage generator
PYTHONPATH=. sphinx-build -N -btexinfo docs/ build/info
makeinfo --no-split build/info/Elpy.texi -o build/info/elpy.info
It was trivially easy to figure out how to build info pages, based on
the manpage generator example.
I imagine something like wrapping the relevant sections of the
overridden dh_auto_build with a conditional check would do the trick,
but I haven't yet found an example, nor documentation of "nodocs".
eg:
override_dh_auto_build:
dh_auto_build
ifeq ($(nodocs),"YET_UNKNOWN_VALUE_SHOULD_EVAL_FALSE_FOR_NORMAL_BUILD")
PYTHONPATH=. sphinx-build -N -bman docs/ build/man # Manpage generator
PYTHONPATH=. sphinx-build -N -btexinfo docs/ build/info
makeinfo --no-split build/info/Elpy.texi -o build/info/elpy.info
endif
The trouble is there are no booleans in Makefiles, and an undefined
variable doesn't eval to nil like in LISPs. So I don't know how to
proceed.
Cheers,
Nicholas
Attachment:
signature.asc
Description: PGP signature