diff --git a/python-dns.spec b/python-dns.spec index 3be23cc..1ebafbc 100644 --- a/python-dns.spec +++ b/python-dns.spec @@ -2,9 +2,19 @@ %global py_package_name dns %global rctag %{nil} +%if 0%{?rhel} +%bcond_with trio +%bcond_with curio +%bcond_with doh +%else +%bcond_without trio +%bcond_without curio +%bcond_without doh +%endif + Name: python-%{py_package_name} Version: 2.1.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: DNS toolkit for Python # The entire package is licensed with both licenses, see LICENSE file @@ -17,11 +27,19 @@ BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-cryptography +%if %{with trio} BuildRequires: python3-trio +%endif +%if %{with curio} BuildRequires: python3-curio +%endif +%if %{with trio} || %{with curio} BuildRequires: python3-sniffio +%endif +%if %{with doh} BuildRequires: python3-requests BuildRequires: python3-requests-toolbelt +%endif BuildRequires: python3-idna BuildRequires: python3-pytest @@ -44,9 +62,6 @@ Summary: %{summary} %description -n python3-%{py_package_name} %_description -# curio extras cannot be packages because nothing provides python3.9dist(curio) >= 1.2 -%{?python_extras_subpkg:%python_extras_subpkg -n python3-dns -i %{python3_sitelib}/*.egg-info dnssec trio doh idna} - %prep %autosetup -p1 -n %{pypi_name}-%{version}%{rctag} @@ -61,15 +76,45 @@ find examples -type f | xargs chmod a-x %check # Skipped test: https://github.com/rthalley/dnspython/issues/590#issuecomment-729644000 -%pytest -k "not test_override" +# testCanonicalNameDangling is failing with +# AssertionError: != +pytest -k "not test_override" -k "not testCanonicalNameDangling" %files -n python3-%{py_package_name} %license LICENSE %doc README.md examples +%{?python_extras_subpkg:%pycached %exclude %{python3_sitelib}/dns/_trio_backend.py} +%{?python_extras_subpkg:%pycached %exclude %{python3_sitelib}/dns/_curio_backend.py} %{python3_sitelib}/%{py_package_name} %{python3_sitelib}/%{pypi_name}-*.egg-info +%{?python_extras_subpkg:%python_extras_subpkg -n python3-dns -i %{python3_sitelib}/*.egg-info dnssec idna} + +%if %{with doh} +%{?python_extras_subpkg:%python_extras_subpkg -n python3-dns -i %{python3_sitelib}/*.egg-info doh} +%endif + +%if %{with trio} +%{?python_extras_subpkg: +%python_extras_subpkg -n python3-dns -i %{python3_sitelib}/*.egg-info trio +%pycached %{python3_sitelib}/dns/_trio_backend.py +} +%endif + +%if %{with curio} +%{?python_extras_subpkg: +%python_extras_subpkg -n python3-dns -i %{python3_sitelib}/*.egg-info curio +%pycached %{python3_sitelib}/dns/_curio_backend.py +} +%endif + %changelog +* Tue Mar 09 2021 Christian Heimes - 2.1.0-3 +- Add bconds for extras require trio, curio, and doh +- Move trio and curio backend modules into extras subpackages +- Enable python3-dns+curio meta package +- Skip failing test testCanonicalNameDangling + * Wed Jan 27 2021 Fedora Release Engineering - 2.1.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild