From b64358e81c1e1d65cc8a27cafd674e4843504d08 Mon Sep 17 00:00:00 2001 From: yatin Date: Thu, 28 Sep 2017 12:13:58 +0530 Subject: [PATCH] Add doc guard for doc sub packaging https://github.com/redhat-openstack/easyfix/issues/6 Also use 'html' doc builder explicitly for doc generation. Change-Id: Ia73dbbfe4d4cb5d18c898c94f4c2f837b8022b4a --- openstack-ironic-inspector.spec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/openstack-ironic-inspector.spec b/openstack-ironic-inspector.spec index 0103b3e..3ded8c3 100644 --- a/openstack-ironic-inspector.spec +++ b/openstack-ironic-inspector.spec @@ -2,6 +2,8 @@ %global modulename ironic_inspector %{!?upstream_version: %global upstream_version %{version}} +%global with_doc 1 + Name: openstack-ironic-inspector Summary: Hardware introspection service for OpenStack Ironic Version: XXX @@ -46,11 +48,9 @@ BuildRequires: python-oslo-i18n BuildRequires: python-oslo-log BuildRequires: python-oslo-middleware BuildRequires: python-oslo-serialization -BuildRequires: python-oslo-sphinx BuildRequires: python-oslo-utils BuildRequires: python-oslotest BuildRequires: python-six -BuildRequires: python-sphinx BuildRequires: python-sqlalchemy BuildRequires: python-stevedore BuildRequires: python-swiftclient @@ -102,11 +102,16 @@ properties discovery is a process of getting hardware parameters required for scheduling from a bare metal node, given it’s power management credentials (e.g. IPMI address, user name and password). +%if 0%{?with_doc} %package -n openstack-ironic-inspector-doc Summary: Documentation for Ironic Inspector. +BuildRequires: python-sphinx +BuildRequires: python-oslo-sphinx + %description -n openstack-ironic-inspector-doc Documentation for Ironic Inspector. +%endif %package -n python-%{service}-tests Summary: %{service} Tempest plugin @@ -125,7 +130,9 @@ It contains the unit tests and tempest plugins %build %{__python2} setup.py build -%{__python2} setup.py build_sphinx +%if 0%{?with_doc} +%{__python2} setup.py build_sphinx -b html +%endif %install %{__python2} setup.py install --skip-build --root=%{buildroot} @@ -185,9 +192,11 @@ mkdir -p %{buildroot}%{_sharedstatedir}/ironic-inspector %doc %{_mandir}/man8/ironic-inspector.8.gz %exclude %{python2_sitelib}/%{modulename}_tests.egg-info +%if 0%{?with_doc} %files -n openstack-ironic-inspector-doc %license LICENSE %doc CONTRIBUTING.rst doc/build/html +%endif %files -n python-%{service}-tests %license LICENSE