diff --git a/ansible.spec b/ansible.spec index 0ee7813..142db17 100644 --- a/ansible.spec +++ b/ansible.spec @@ -9,6 +9,12 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %endif +%if 0%{?fedora} || 0%{?rhel} >= 8 +%global with_docs 1 +%else +%global with_docs 0 +%endif + %if 0%{?fedora} %global with_python3 1 %else @@ -217,7 +223,7 @@ cp -a . %{py3dir} %{__python2} setup.py build # Build docs # EPEL6/7 don't have a recent enough sphinx to build the docs -%if 0%{?fedora} || 0%{?rhel} >= 8 +%if %with_docs make webdocs %endif @@ -260,7 +266,7 @@ mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1 cp -v docs/man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1/ cp -pr docs/docsite/rst . -%if 0%{?fedora} || 0%{?rhel} >= 8 +%if %with_docs cp -pr docs/docsite/_build/html . %endif @@ -320,7 +326,7 @@ rm -rf $RPM_BUILD_ROOT %files -n ansible-doc %doc rst -%if 0%{?fedora} || 0%{?rhel} >= 8 +%if %with_docs %doc html %endif