fix doc generation

This commit is contained in:
rpmbuild 2019-11-09 03:00:29 +00:00
parent 0b2bf2c344
commit 3acaaf50e8

View File

@ -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 <rebus _AT seznam.cz> - 2.4.3-3