From 9bb6780123522a64c43fb556e1f7c2a61759d269 Mon Sep 17 00:00:00 2001 From: Tomas Hrnciar Date: Wed, 12 May 2021 11:21:44 +0200 Subject: [PATCH] Add bcond to build filelock without docs --- python-filelock.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python-filelock.spec b/python-filelock.spec index 52eb53e..7d704c8 100644 --- a/python-filelock.spec +++ b/python-filelock.spec @@ -21,7 +21,8 @@ file locking mechanism for Python. The lock includes a lock counter and is thread safe. This means, when locking the same lock object twice, it will not block. - +%bcond_without docs +%if %{with docs} %package doc Summary: Documentation for %{srcname}, %{summary} BuildRequires: make @@ -30,6 +31,7 @@ BuildRequires: python%{python3_pkgversion}-sphinx-theme-alabaster %description doc %{summary} +%endif %if 0%{?with_python2} @@ -87,8 +89,10 @@ the same lock object twice, it will not block. %py3_build %endif # with_python3 +%if %{with docs} %make_build -C docs html man SPHINXBUILD=sphinx-build-%{python3_version} rm docs/build/html/.buildinfo +%endif %install @@ -100,7 +104,9 @@ rm docs/build/html/.buildinfo %py3_install %endif # with_python3 +%if %{with docs} install -p -m0644 -D docs/build/man/py-%{srcname}.1 %{buildroot}%{_mandir}/man1/py-%{srcname}.1 +%endif %check @@ -113,9 +119,11 @@ install -p -m0644 -D docs/build/man/py-%{srcname}.1 %{buildroot}%{_mandir}/man1/ %endif # with_python3 +%if %{with docs} %files doc %license LICENSE %doc docs/build/html +%endif %if 0%{?with_python2} %files -n python2-%{srcname} @@ -134,7 +142,9 @@ install -p -m0644 -D docs/build/man/py-%{srcname}.1 %{buildroot}%{_mandir}/man1/ %{python3_sitelib}/%{srcname}.py %{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/__pycache__/%{srcname}*.py[co] +%if %{with docs} %{_mandir}/man1/py-%{srcname}.1.gz +%endif %endif # with_python3