From 64f555eb7e1dde9d7effad9bafe4c6bc59f4ca79 Mon Sep 17 00:00:00 2001 From: George Notaras Date: Mon, 13 Jan 2014 03:23:38 +0200 Subject: [PATCH] Improved the documentation that is packaged in the RPM. Until now, only the documentation in source form was packaged. This changeset improves the RPM generator so that the compiled HTML version of the documentation is packaged. Also, other informative documents (README, LICENSE, NOTICE, THANKS) and an example server configuration file have been included. Finally, the Sphinx documentation's conf.py has been improved so that it is easier to compile the docs using the default theme. --- docs/source/conf.py | 10 +++++++--- rpm/install | 5 ++++- setup.cfg | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index ac434825..6c170a39 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -31,9 +31,13 @@ pygments_style = 'sphinx' # -- Options for HTML output --------------------------------------------------- if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + try: + import sphinx_rtd_theme + except ImportError: + html_theme = 'default' + else: + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] else: html_theme = 'default' diff --git a/rpm/install b/rpm/install index 86a9c324..4a8f9dc7 100644 --- a/rpm/install +++ b/rpm/install @@ -1,5 +1,8 @@ %{__python} setup.py install --skip-build --root=$RPM_BUILD_ROOT +# Build the HTML documentation using the default theme. +%{__python} setup.py build_sphinx + %if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} @@ -8,6 +11,6 @@ INSTALLED_FILES="\ %{python_sitelib}/* %{_bindir}/* -%doc docs +%doc LICENSE NOTICE README.rst THANKS build/sphinx/html examples/example_config.py " echo "$INSTALLED_FILES" > INSTALLED_FILES diff --git a/setup.cfg b/setup.cfg index a0367bab..c11ea43a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bdist_rpm] -build-requires = python2-devel python-setuptools +build-requires = python2-devel python-setuptools python-sphinx requires = python-setuptools >= 0.6c6 python-ctypes install_script = rpm/install group = System Environment/Daemons