%global python3_pkgversion 3.11 %global srcname twisted %global common_description %{expand: Twisted is a networking engine written in Python, supporting numerous protocols. It contains a web server, numerous chat clients, chat servers, mail servers and more.} Name: python-%{srcname} Version: 23.10.0 Release: 2.ac16.py3.11%{?dist} Summary: Twisted is a networking engine written in Python License: MIT URL: http://twistedmatrix.com/ VCS: https://github.com/twisted/twisted Source0: %vcs/archive/%{srcname}-%{version}/%{srcname}-%{version}.tar.gz # https://github.com/twisted/twisted/pull/12027 # https://github.com/twisted/twisted/issues/12026 Patch1: 0001-Adjust-to-deprecation-of-3-arg-signature-of-generato.patch # downstream-only fix tests, skip network tests that fail in buildsys Patch2: 0002-23.10.0-fix-and-skip-tests-fedora.patch # https://github.com/twisted/twisted/issues/12052 # https://github.com/twisted/twisted/pull/12054 Patch3: 0003-python3.12.1.patch # Three backported upstream commits to remove cgi module (removed from Python 3.13) # https://github.com/twisted/twisted/commit/e6bf82b0a703e4bc78934d # https://github.com/twisted/twisted/commit/2bceedc79f86c750f27432 # https://github.com/twisted/twisted/commit/4579398f6b089f93181ba2 Patch4: 0004-Remove-the-usage-of-cgi.parse_multipart.patch # In Python 3.13 line numbers returned by findlinestarts # can be None for bytecode that does not map to source lines. # https://github.com/twisted/twisted/pull/12059 Patch5: 0005-Update-dis.findlinestarts-for-Python-3.13.patch BuildArch: noarch %description %{common_description} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel >= 3.3 BuildRequires: python%{python3_pkgversion}-pyasn1-modules, python3-cryptography, python3-pynacl BuildRequires: python%{python3_pkgversion}-service-identity, python3-pyOpenSSL, python3-h2 BuildRequires: python%{python3_pkgversion}-bcrypt, python3-subunit BuildRequires: python%{python3_pkgversion}-hamcrest, python3-hypothesis BuildRequires: git-core Recommends: python3-%{srcname}+tls %description -n python%{python3_pkgversion}-%{srcname} %{common_description} %pyproject_extras_subpkg -n python3-%{srcname} tls %prep %autosetup -p1 -n %{srcname}-%{srcname}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install # no-manual-page-for-binary mkdir -p %{buildroot}%{_mandir}/man1/ for s in conch core mail; do cp -a docs/$s/man/*.1 %{buildroot}%{_mandir}/man1/ done # Packages that install arch-independent twisted plugins install here. # https:# bugzilla.redhat.com/show_bug.cgi?id=1252140 mkdir -p %{buildroot}%{python3_sitelib}/twisted/plugins # Move and symlink python3 scripts %pyproject_save_files %{srcname} echo "%ghost %{python3_sitelib}/twisted/plugins/dropin.cache" >> %{pyproject_files} %check 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}-twisted -f %{pyproject_files} %doc NEWS.rst README.rst %license LICENSE %{_bindir}/cftp-%{python3_pkgversion} %{_bindir}/ckeygen-%{python3_pkgversion} %{_bindir}/conch-%{python3_pkgversion} %{_bindir}/mailmail-%{python3_pkgversion} %{_bindir}/pyhtmlizer-%{python3_pkgversion} %{_bindir}/tkconch-%{python3_pkgversion} %{_bindir}/trial-%{python3_pkgversion} %{_bindir}/twist-%{python3_pkgversion} %{_bindir}/twistd-%{python3_pkgversion} %{_mandir}/man1/cftp-%{python3_pkgversion}.1* %{_mandir}/man1/ckeygen-%{python3_pkgversion}.1* %{_mandir}/man1/conch-%{python3_pkgversion}.1* %{_mandir}/man1/mailmail-%{python3_pkgversion}.1* %{_mandir}/man1/pyhtmlizer-%{python3_pkgversion}.1* %{_mandir}/man1/tkconch-%{python3_pkgversion}.1* %{_mandir}/man1/trial-%{python3_pkgversion}.1* %{_mandir}/man1/twistd-%{python3_pkgversion}.1* %changelog * Tue May 14 2024 Ding-Yi Chen - 23.10.0-2.ac16.py3.11 - Cut corner packaging