Skip to content

Commit

Permalink
Add with_doc guard for -doc subpackage
Browse files Browse the repository at this point in the history
Added conditionals over -doc subpackage to guard against package break if/when
dependencies are added.

Per RDO request redhat-openstack/easyfix#6

Change-Id: I1be54bc9e15272459f3d2007bcf99ca1d1f0af65
  • Loading branch information
OGtrilliams authored and amoralej committed Aug 7, 2017
1 parent f8dd7e6 commit 533c77f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion python-oslo-concurrency.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
%endif

%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global with_doc 1

%global pypi_name oslo.concurrency
%global pkg_name oslo-concurrency
Expand Down Expand Up @@ -54,19 +55,24 @@ Oslo concurrency library has utilities for safely running multi-thread,
multi-process applications using locking mechanisms and for running
external processes.

%if 0%{?with_doc}

%package -n python-%{pkg_name}-doc
Summary: Documentation for the Oslo concurrency library
Group: Documentation

BuildRequires: python-sphinx
BuildRequires: python-openstackdocstheme
BuildRequires: python-fixtures
BuildRequires: python-oslo-config
BuildRequires: python-oslo-utils
BuildRequires: python-fasteners

%description -n python-%{pkg_name}-doc
Documentation for the Oslo concurrency library.

%endif

%package -n python2-%{pkg_name}-tests
Summary: Tests for the Oslo concurrency library
%{?python_provide:%python_provide python2-%{pkg_name}-tests}
Expand Down Expand Up @@ -143,11 +149,12 @@ rm -rf {test-,}requirements.txt
# Generate i18n files
%{__python2} setup.py compile_catalog -d build/lib/oslo_concurrency/locale

%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
%if 0%{?with_python3}
Expand Down Expand Up @@ -191,9 +198,11 @@ rm -rf .testrepository
%{python2_sitelib}/*.egg-info
%exclude %{python2_sitelib}/oslo_concurrency/tests

%if 0%{?with_doc}
%files -n python-%{pkg_name}-doc
%license LICENSE
%doc doc/build/html
%endif

%files -n python2-%{pkg_name}-tests
%{python2_sitelib}/oslo_concurrency/tests
Expand Down

0 comments on commit 533c77f

Please sign in to comment.