diff --git a/python-sortedcontainers.spec b/python-sortedcontainers.spec index 7d12389..d497825 100644 --- a/python-sortedcontainers.spec +++ b/python-sortedcontainers.spec @@ -23,14 +23,23 @@ Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%bcond_without tests +%if %{with tests} BuildRequires: python3-pytest BuildRequires: python3-matplotlib BuildRequires: python3-numpy BuildRequires: python3-scipy +%endif + +%bcond_without docs +%if %{with docs} BuildRequires: python3-sphinx BuildRequires: dvipng BuildRequires: tex(anyfontsize.sty) BuildRequires: tex(bm.sty) +%endif %description -n python3-%{srcname} %{_description} @@ -49,33 +58,39 @@ Documentation for %{srcname} package. %build %py3_build +%if %{with docs} pushd docs make SPHINXBUILD=sphinx-build-%{python3_version} html rm _build/html/.buildinfo popd +%endif %install %py3_install +%if %{with tests} %check pushd tests PYTHONPATH="%{buildroot}%{python3_sitelib}" \ pytest-%{python3_version} popd +%endif %files -n python3-%{srcname} %license LICENSE %doc README.rst %{python3_sitelib}/%{srcname} -%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info +%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/ +%if %{with docs} %files -n python-%{srcname}-doc %license LICENSE %doc README.rst docs/_build/html +%endif %changelog