Enable build of documentation using Sphinx.
authorBen Finney <[email protected]>
Mon, 8 Aug 2016 10:13:21 +0000 (8 20:13 +1000)
committerBen Finney <[email protected]>
Mon, 8 Aug 2016 19:09:45 +0000 (9 05:09 +1000)
debian/changelog
debian/control
debian/rules

index 84f4c94..765969f 100644 (file)
@@ -14,6 +14,8 @@ python-coverage (4.2+dfsg.1-1) UNRELEASED; urgency=medium
   * debian/control:
     * Declare the package for upstream documentation.
     * Add dependencies on the documentation package.
+  * debian/control, debian/rules:
+    * Enable build of upstream documentation using Sphinx.
 
  --
 
index fa6912b..1c8b1b9 100644 (file)
@@ -4,6 +4,9 @@ Section: python
 Priority: optional
 Build-Depends:
     dh-python,
+    python3-sphinx,
+    python3-sphinx-rtd-theme,
+    python3-sphinxcontrib.spelling,
     python-docutils,
     python-setuptools,
     python-all-dev (>= 2.6.6-3~),
index c86094f..a63925e 100755 (executable)
@@ -50,6 +50,10 @@ versioned_manpage_paths = $(addprefix ${DOCUMENTATION_DIR}/, \
 GENERATED_FILES += ${DOCUMENTATION_DIR}/*${MANPAGE_SUFFIX}
 GENERATED_FILES += ${DOCUMENTATION_DIR}/*${manpage_tempfile_suffix}
 
+DOCUMENTATION_BUILD_DIR = ${DOCUMENTATION_DIR}/_build
+DOCUMENTATION_BUILD_HTML_DIR = ${DOCUMENTATION_BUILD_DIR}/html
+GENERATED_FILES += ${DOCUMENTATION_BUILD_DIR}
+
 INSTALL = install
 
 # Send HTTP traffic to the “discard” service during packaging actions.
@@ -60,9 +64,12 @@ RST_SUFFIX = .txt
 
 RST2MAN = rst2man
 
+SPHINX = sphinx-build
+SPHINX_OPTS = -N
+
 \f
 %:
-       dh $@ --with python2,python3 --buildsystem=pybuild
+       dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
 
 \f
 .PHONY: remove-bundled-libraries
@@ -149,6 +156,11 @@ override_dh_auto_clean:
        dh_auto_clean
        $(RM) -r ${GENERATED_FILES}
 
+override_dh_auto_build:
+       dh_auto_build
+       $(SPHINX) ${SPHINX_OPTS} -bhtml ${DOCUMENTATION_DIR}/ \
+               ${DOCUMENTATION_BUILD_HTML_DIR}/
+
 \f
 # Local variables:
 # mode: makefile