Blame SPECS/python-service-identity.spec

5a1866
%bcond tests 1
5a1866
%bcond docs %{undefined rhel}
5a1866
5a1866
Name:           python-service-identity
5a1866
Version:        24.2.0
5a1866
Release:        2%{?dist}
5a1866
Summary:        Service identity verification for pyOpenSSL & cryptography
5a1866
License:        MIT
5a1866
URL:            https://github.com/pyca/service-identity
5a1866
Source:         %{pypi_source service_identity}
5a1866
# Downstream-only patch to remove coverage[toml] test dependency
5a1866
Patch:          0001-Remove-coverage-toml-test-dependency.patch
5a1866
# Downstream-only patch to remove hatch-fancy-pypi-readme build-system dependency
5a1866
Patch:          0002-Remove-hatch-fancy-pypi-readme-build-system-dependency.patch
5a1866
5a1866
BuildArch:      noarch
5a1866
BuildRequires:  python3-devel
5a1866
5a1866
%global common_description %{expand:
5a1866
Use this package if you want to verify that a PyCA cryptography certificate is
5a1866
valid for a certain hostname or IP address, or if you use pyOpenSSL and don’t
5a1866
want to be MITMed, or if you want to inspect certificates from either for
5a1866
service IDs.  service-identity aspires to give you all the tools you need for
5a1866
verifying whether a certificate is valid for the intended purposes.  In the
5a1866
simplest case, this means host name verification.  However, service-identity
5a1866
implements RFC 6125 fully.}
5a1866
5a1866
%description %{common_description}
5a1866
5a1866
%package -n     python3-service-identity
5a1866
Summary:        %{summary}
5a1866
5a1866
%description -n python3-service-identity %{common_description}
5a1866
5a1866
%package doc
5a1866
Summary:        Documentation for %{name}
5a1866
5a1866
%description doc
5a1866
%{common_description}
5a1866
5a1866
This is the documentation package for %{name}.
5a1866
5a1866
%pyproject_extras_subpkg -n python3-service-identity idna
5a1866
5a1866
%prep
5a1866
%autosetup -p1 -n service_identity-%{version}
5a1866
5a1866
%generate_buildrequires
5a1866
%pyproject_buildrequires %{?with_tests:-x tests,idna} %{?with_docs:-x docs}
5a1866
5a1866
%build
5a1866
%pyproject_wheel
5a1866
5a1866
%install
5a1866
%pyproject_install
5a1866
%pyproject_save_files -l service_identity
5a1866
5a1866
%if %{with docs}
5a1866
# Previously the docs were built with PYTHONPATH=%%{pyproject_build_lib}, but
5a1866
# that macro is now deprecated.  It also only works with setuptools, and
5a1866
# upstream switched to hatchling.  Building the docs relies on the library
5a1866
# being installed, so we have to do it here in %%install instead of in %%build.
5a1866
PYTHONPATH=%{buildroot}%{python3_sitelib} sphinx-build docs html
5a1866
# remove the sphinx-build leftovers
5a1866
rm -rf html/.{doctrees,buildinfo}
5a1866
%endif
5a1866
5a1866
%check
5a1866
%if %{with tests}
5a1866
%pytest -v
5a1866
%else
5a1866
%pyproject_check_import
5a1866
%endif
5a1866
5a1866
%files -n python3-service-identity -f %{pyproject_files}
5a1866
%doc README.md
5a1866
5a1866
%if %{with docs}
5a1866
%files doc
5a1866
%doc html
5a1866
%license LICENSE
5a1866
%endif
5a1866
5a1866
%changelog