@@ -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.
 
  --
 
 
@@ -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~),
 
@@ -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