diff --git a/python-oslo-service.spec b/python-oslo-service.spec index 4ce6fac..e01a9c1 100644 --- a/python-oslo-service.spec +++ b/python-oslo-service.spec @@ -1,7 +1,7 @@ %{!?upstream_version: %global upstream_version %{version}%{?milestone}} %global pypi_name oslo.service %global pname oslo-service - +%global with_doc 1 %if 0%{?fedora} >= 24 %global with_python3 1 %endif @@ -30,8 +30,6 @@ BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-pbr >= 2.0.0 BuildRequires: git -BuildRequires: python-sphinx -BuildRequires: python-openstackdocstheme BuildRequires: python-oslo-i18n BuildRequires: python-paste BuildRequires: python-paste-deploy @@ -142,11 +140,16 @@ Requires: python3-oslotest %{common_desc1} %endif - +%if 0%{?with_doc} %package -n python-%{pname}-doc Summary: Oslo service documentation + +BuildRequires: python-sphinx +BuildRequires: python-openstackdocstheme + %description -n python-%{pname}-doc Documentation for oslo.service +%endif %description %{common_desc} @@ -159,10 +162,13 @@ Documentation for oslo.service %if 0%{?with_python3} %py3_build %endif + +%if 0%{?with_doc} # generate html docs %{__python2} setup.py build_sphinx -b html # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} +%endif %install # Must do the subpackages' install first because the scripts in /usr/bin are @@ -203,8 +209,10 @@ rm -rf .testrepository %{python3_sitelib}/oslo_service/tests %endif +%if 0%{?with_doc} %files -n python-%{pname}-doc %doc doc/build/html %license LICENSE +%endif %changelog