Skip to content

Commit

Permalink
Added the doc_guard
Browse files Browse the repository at this point in the history
redhat-openstack/easyfix#6

Change-Id: I34d0cae4c7160ff7c78ff009a91b99a4463375ec
  • Loading branch information
jatanmalde authored and karelyatin committed Dec 21, 2017
1 parent 927a789 commit b21a6d2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions python-oslo-service.spec
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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

0 comments on commit b21a6d2

Please sign in to comment.