diff --git a/scapy.spec b/scapy.spec index e5426d3..90194c0 100644 --- a/scapy.spec +++ b/scapy.spec @@ -33,6 +33,16 @@ requests and replies, and much more.} %bcond_with python2 %endif +# By default build the documentation +%if 0%{?fedora} || ( 0%{?rhel} && 0%{?rhel} >= 8 ) +%bcond_without doc +%else +# Documentation build fails on rhel7 due to version of sphinx +%bcond_with doc +%endif + + + BuildArch: noarch @@ -92,13 +102,16 @@ Recommends: ipython3 %{common_desc} %endif +%if 0%{?with_doc} %package doc Summary: Interactive packet manipulation tool and network scanner -BuildRequires: /usr/bin/sphinx-build +BuildRequires: python%{python3_pkgversion}-sphinx +BuildRequires: python%{python3_pkgversion}-sphinx_rtd_theme %description doc %{common_desc} +%endif @@ -125,12 +138,12 @@ done %py3_build %endif -pushd doc/scapy -make html -popd +%if 0%{?with_doc} +make -C doc/scapy html BUILDDIR=_build_doc SPHINXBUILD=sphinx-build-%python3_version -rm -f doc/scapy/_build/html/.buildinfo -rm -f doc/scapy/_build/html/_static/_dummy +rm -f doc/scapy/_build_doc/html/.buildinfo +rm -f doc/scapy/_build_doc/html/_static/_dummy +%endif @@ -206,8 +219,11 @@ ln -s %{_bindir}/UTscapy3 %{buildroot}%{_bindir}/UTscapy %endif +%if 0%{?with_doc} %files doc -%doc doc/scapy/_build/html +%doc doc/scapy/_build_doc/html +%endif + %changelog * Fri Nov 08 2019 Michal Ambroz - 2.4.3-3