Add a docs bcond
This commit is contained in:
parent
97ff77069f
commit
d49fb37ae7
@ -1,3 +1,4 @@
|
|||||||
|
%bcond_without docs
|
||||||
%global pypi_name testpath
|
%global pypi_name testpath
|
||||||
|
|
||||||
Name: python-%{pypi_name}
|
Name: python-%{pypi_name}
|
||||||
@ -17,8 +18,10 @@ BuildRequires: python3-devel
|
|||||||
|
|
||||||
BuildRequires: python3-flit
|
BuildRequires: python3-flit
|
||||||
|
|
||||||
|
%if %{with docs}
|
||||||
BuildRequires: python3-sphinx
|
BuildRequires: python3-sphinx
|
||||||
BuildRequires: python3-sphinx_rtd_theme
|
BuildRequires: python3-sphinx_rtd_theme
|
||||||
|
%endif
|
||||||
|
|
||||||
# Tests:
|
# Tests:
|
||||||
BuildRequires: python3-pytest
|
BuildRequires: python3-pytest
|
||||||
@ -40,10 +43,12 @@ Summary: %summary
|
|||||||
|
|
||||||
%_description
|
%_description
|
||||||
|
|
||||||
|
%if %{with docs}
|
||||||
%package doc
|
%package doc
|
||||||
Summary: %{name} documentation
|
Summary: %{name} documentation
|
||||||
%description doc
|
%description doc
|
||||||
Documentation for %{name}.
|
Documentation for %{name}.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
@ -59,10 +64,12 @@ rm -f %{pypi_name}/*.exe
|
|||||||
# we use flit to create a wheel from sources
|
# we use flit to create a wheel from sources
|
||||||
flit build --format wheel
|
flit build --format wheel
|
||||||
|
|
||||||
|
%if %{with docs}
|
||||||
# generate html docs
|
# generate html docs
|
||||||
sphinx-build-3 doc html
|
sphinx-build-3 doc html
|
||||||
# remove the sphinx-build leftovers
|
# remove the sphinx-build leftovers
|
||||||
rm -rf html/.{doctrees,buildinfo}
|
rm -rf html/.{doctrees,buildinfo}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -81,8 +88,10 @@ rm -rf html/.{doctrees,buildinfo}
|
|||||||
%{python3_sitelib}/%{pypi_name}-%{version}.dist-info/
|
%{python3_sitelib}/%{pypi_name}-%{version}.dist-info/
|
||||||
%{python3_sitelib}/%{pypi_name}/
|
%{python3_sitelib}/%{pypi_name}/
|
||||||
|
|
||||||
|
%if %{with docs}
|
||||||
%files doc
|
%files doc
|
||||||
%doc html
|
%doc html
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
|
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
|
||||||
|
Loading…
Reference in New Issue
Block a user