Add idna extras subpackage and switch to pyproject macros

epel9 imports/e9/python-service-identity-21.1.0-5.el9
Carl George 3 years ago
parent b1bcedc0ef
commit 9110429ece

@ -1,58 +1,40 @@
%bcond_without check
%global modname service-identity
%global srcname service_identity
Name: python-%{modname}
Version: 21.1.0
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Service identity verification for pyOpenSSL
License: MIT
URL: https://github.com/pyca/service_identity
URL: https://github.com/pyca/service-identity
Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz
# Revert theme change as "furo" theme is not packaged
Patch0: 0001-Revert-theme-change.patch
BuildArch: noarch
%global _description \
Service Identity Verification for pyOpenSSL.\
\
TL;DR: Use this package if you use pyOpenSSL and dont want to be MITMed.\
\
service_identity aspires to give you all the tools you need for verifying\
whether a certificate is valid for the intended purposes.\
\
In the simplest case, this means host name verification. However,\
service_identity implements RFC 6125 fully and plans to add other\
relevant RFCs too.
%global common_description %{expand:
Use this package if you use pyOpenSSL and dont want to be MITMed, or if you
want to verify that a PyCA cryptography certificate is valid for a certain
hostname or IP address. service-identity aspires to give you all the tools you
need for verifying whether a certificate is valid for the intended purposes.
In the simplest case, this means host name verification. However,
service-identity implements RFC 6125 fully and plans to add other relevant RFCs
too.}
%description %{_description}
%description %{common_description}
%package -n python3-%{modname}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires: python3-devel
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(sphinx)
BuildRequires: %{py3_dist sphinx}
%if %{with check}
BuildRequires: python3dist(attrs) >= 19.1.0
BuildRequires: python3dist(idna) >= 0.6
BuildRequires: python3dist(pyasn1)
BuildRequires: python3dist(pyasn1-modules)
BuildRequires: python3dist(pyopenssl) >= 0.14
BuildRequires: python3dist(pytest)
BuildRequires: %{py3_dist pytest}
%endif
Requires: python3dist(attrs)
Requires: python3dist(pyasn1)
Requires: python3dist(pyasn1-modules)
Requires: python3dist(pyopenssl) >= 0.14
Recommends: python3dist(idna) >= 0.6
%description -n python3-%{modname} %{_description}
Python 3 version.
%description -n python3-%{modname} %{common_description}
%package -n python-%{modname}-doc
Summary: Service-identity documentation
@ -60,14 +42,22 @@ Summary: Service-identity documentation
%description -n python-%{modname}-doc
Documentation for service-identity.
%pyproject_extras_subpkg -n python3-%{modname} idna
%prep
%autosetup -p1 -n %{modname}-%{version}
%generate_buildrequires
%if %{with check}
%pyproject_buildrequires -x idna
%endif
%build
%py3_build
%pyproject_wheel
%install
%py3_install
%pyproject_install
%pyproject_save_files service_identity
# generate html docs
PYTHONPATH=%{buildroot}%{python3_sitelib} sphinx-build-3 docs html
@ -76,20 +66,21 @@ rm -rf html/.{doctrees,buildinfo}
%if %{with check}
%check
PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v
%pytest -v
%endif
%files -n python3-%{modname}
%license LICENSE
%files -n python3-%{modname} -f %{pyproject_files}
%doc README.rst
%{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}/
%files -n python-%{modname}-doc
%doc html
%license LICENSE docs/license.rst
%changelog
* Fri Jan 28 2022 Carl George <carl@george.computer> - 21.1.0-5
- Add idna extras subpackage
- Switch to pyproject macros
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 21.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

Loading…
Cancel
Save