diff --git a/python-testpath.spec b/python-testpath.spec index ae09383..c591ea3 100644 --- a/python-testpath.spec +++ b/python-testpath.spec @@ -1,3 +1,4 @@ +%bcond_without docs %global pypi_name testpath Name: python-%{pypi_name} @@ -17,8 +18,10 @@ BuildRequires: python3-devel BuildRequires: python3-flit +%if %{with docs} BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme +%endif # Tests: BuildRequires: python3-pytest @@ -40,10 +43,12 @@ Summary: %summary %_description +%if %{with docs} %package doc Summary: %{name} documentation %description doc Documentation for %{name}. +%endif %prep @@ -59,10 +64,12 @@ rm -f %{pypi_name}/*.exe # we use flit to create a wheel from sources flit build --format wheel +%if %{with docs} # generate html docs sphinx-build-3 doc html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} +%endif %install @@ -81,8 +88,10 @@ rm -rf html/.{doctrees,buildinfo} %{python3_sitelib}/%{pypi_name}-%{version}.dist-info/ %{python3_sitelib}/%{pypi_name}/ +%if %{with docs} %files doc %doc html +%endif %changelog * Fri Jul 22 2022 Fedora Release Engineering - 0.6.0-3