diff --git a/python-olefile.spec b/python-olefile.spec index e9d0538..5931cae 100644 --- a/python-olefile.spec +++ b/python-olefile.spec @@ -22,6 +22,7 @@ BuildArch: noarch %description %{_description} +%if 0%{?fedora} || 0%{?rhel} == 7 %package -n python2-%{srcname} Summary: %{summary} BuildRequires: python2-devel @@ -34,13 +35,14 @@ BuildRequires: python2-sphinx %description -n python2-%{srcname} %{_description} Python2 version. +%endif %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel # There is no python34-sphinx package in EPEL 7 -%if 0%{?fedora} +%if 0%{?fedora} || 0%{?rhel} >= 8 BuildRequires: python%{python3_pkgversion}-sphinx BuildRequires: python%{python3_pkgversion}-sphinx_rtd_theme %endif @@ -56,19 +58,23 @@ Python3 version. %build +%if 0%{?fedora} || 0%{?rhel} == 7 %py2_build %if 0%{?fedora} && 0%{?fedora} < 31 make -C doc html BUILDDIR=_build_py2 SPHINXBUILD=sphinx-build-%python2_version %endif +%endif %py3_build -%if 0%{?fedora} +%if 0%{?fedora} || 0%{?rhel} >= 8 make -C doc html BUILDDIR=_build_py3 SPHINXBUILD=sphinx-build-%python3_version %endif %install +%if 0%{?fedora} || 0%{?rhel} == 7 %py2_install +%endif %py3_install @@ -79,6 +85,7 @@ make -C doc html BUILDDIR=_build_py3 SPHINXBUILD=sphinx-build-%python3_version # PYTHONPATH=%%{buildroot}%%{python3_sitelib} %%{__python3} tests/test_olefile.py +%if 0%{?fedora} || 0%{?rhel} == 7 %files -n python2-%{srcname} %doc README.md %if 0%{?fedora} && 0%{?fedora} < 31 @@ -87,10 +94,11 @@ make -C doc html BUILDDIR=_build_py3 SPHINXBUILD=sphinx-build-%python3_version %license doc/License.rst %{python2_sitelib}/olefile-*.egg-info %{python2_sitelib}/olefile/ +%endif %files -n python%{python3_pkgversion}-%{srcname} %doc README.md -%if 0%{?fedora} +%if 0%{?fedora} || 0%{?rhel} >= 8 %doc doc/_build_py3/html %endif %license doc/License.rst