%global python3_pkgversion 3.11 %bcond tests 0 %bcond docs 1 %global common_description %{expand: Use this package if you use pyOpenSSL and don’t 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.} Name: python-service-identity Version: 23.1.0 Release: 2.ac15.py3.11%{?dist} Summary: Service identity verification for pyOpenSSL License: MIT URL: https://github.com/pyca/service-identity Source: %{pypi_source service_identity} # Downstream-only patch to disable coverage Patch: 0001-Remove-coverage-from-tests-extras.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %description %{common_description} %package -n python%{python3_pkgversion}-service-identity Summary: %{summary} %description -n python%{python3_pkgversion}-service-identity %{common_description} %package doc Summary: Documentation for %{name} %description doc %{common_description} This is the documentation package for %{name}. %pyproject_extras_subpkg -n python3-service-identity idna %prep %autosetup -p1 -n service_identity-%{version} %generate_buildrequires %pyproject_buildrequires %{?with_tests:,idna} %{?with_docs:-x docs} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files service_identity %if %{with docs} # Previously the docs were built with PYTHONPATH=%%{pyproject_build_lib}, but # that macro is now deprecated. It also only works with setuptools, and # upstream switched to hatchling. Building the docs relies on the library # being installed, so we have to do it here in %%install instead of in %%build. PYTHONPATH=%{buildroot}%{python3_sitelib} sphinx-build-%{python3_pkgversion} docs html # remove the sphinx-build-%{python3_pkgversion} leftovers rm -rf html/.{doctrees,buildinfo} %endif %check %if %{with tests} %pytest -v %else %pyproject_check_import %endif for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-service-identity -f %{pyproject_files} %doc README.md %if %{with docs} %files doc %doc html %license LICENSE %endif %changelog * Sun May 05 2024 Ding-Yi Chen - 23.1.0-2.ac15.py3.11 - Cut corner packaging