From 8964b163459b4f4ed9c8b6b071061d99fecaa13e Mon Sep 17 00:00:00 2001 From: tigro Date: Sun, 5 Jan 2025 22:06:38 +0300 Subject: [PATCH] import python-zstandard-0.23.0-1.el10 --- .gitignore | 1 + .python-zstandard.metadata | 1 + SOURCES/python-zstandard-deps.patch | 18 +++ SOURCES/python-zstandard-py313.patch | 12 ++ SPECS/python-zstandard.spec | 162 +++++++++++++++++++++++++++ 5 files changed, 194 insertions(+) create mode 100644 .gitignore create mode 100644 .python-zstandard.metadata create mode 100644 SOURCES/python-zstandard-deps.patch create mode 100644 SOURCES/python-zstandard-py313.patch create mode 100644 SPECS/python-zstandard.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ade75e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/zstandard-0.23.0.tar.gz diff --git a/.python-zstandard.metadata b/.python-zstandard.metadata new file mode 100644 index 0000000..1349e9c --- /dev/null +++ b/.python-zstandard.metadata @@ -0,0 +1 @@ +b5a91bd8a0008a61f2ad700beaa949ca11110478 SOURCES/zstandard-0.23.0.tar.gz diff --git a/SOURCES/python-zstandard-deps.patch b/SOURCES/python-zstandard-deps.patch new file mode 100644 index 0000000..a86f4dc --- /dev/null +++ b/SOURCES/python-zstandard-deps.patch @@ -0,0 +1,18 @@ +diff -up zstandard-0.23.0/pyproject.toml.orig zstandard-0.23.0/pyproject.toml +--- zstandard-0.23.0/pyproject.toml.orig 2024-07-14 23:58:50.000000000 +0200 ++++ zstandard-0.23.0/pyproject.toml 2024-10-03 16:27:20.742934487 +0200 +@@ -1,12 +1,12 @@ + [build-system] + requires = [ + "cffi>=1.16.0; python_version <= '3.12'", +- "cffi==1.17.0rc1; python_version >= '3.13'", ++ "cffi>=1.17.0; python_version >= '3.13'", + # 69.0.0 breaks handling of --config-settings=--build-option, which our CI + # relies on. So constrained to an older version until we figure out a + # workaround. See comment at + # https://github.com/pypa/pip/issues/11859#issuecomment-2132287974. +- "setuptools<69.0.0", ++ "setuptools", + ] + # Need to use legacy backend because setup_zstd.py breaks build isolation. + build-backend = "setuptools.build_meta:__legacy__" diff --git a/SOURCES/python-zstandard-py313.patch b/SOURCES/python-zstandard-py313.patch new file mode 100644 index 0000000..641e646 --- /dev/null +++ b/SOURCES/python-zstandard-py313.patch @@ -0,0 +1,12 @@ +diff -up zstandard-0.22.0/c-ext/backend_c.c.orig zstandard-0.22.0/c-ext/backend_c.c +--- zstandard-0.22.0/c-ext/backend_c.c.orig 2023-11-01 07:04:15.000000000 +0100 ++++ zstandard-0.22.0/c-ext/backend_c.c 2023-11-22 12:51:36.452480448 +0100 +@@ -17,6 +17,8 @@ + + #include + ++#elif defined(__linux__) && defined(HAVE_UNISTD_H) ++#include + #endif + + #include "python-zstandard.h" diff --git a/SPECS/python-zstandard.spec b/SPECS/python-zstandard.spec new file mode 100644 index 0000000..6e63511 --- /dev/null +++ b/SPECS/python-zstandard.spec @@ -0,0 +1,162 @@ +%if 0%{?rhel} +%bcond_with check +%else +%bcond_without check +%endif + +%global pypi_name zstandard + +%global desc This project provides Python bindings for interfacing with the Zstandard\ +compression library. A C extension and CFFI interface are provided. + +Name: python-%{pypi_name} +Version: 0.23.0 +Release: 1%{?dist} +Summary: Zstandard bindings for Python +License: (BSD-3-Clause OR GPL-2.0-only) AND MIT +URL: https://github.com/indygreg/python-zstandard +Source0: %{pypi_source} +Patch0: %{name}-py313.patch +# relax dependencies so that auto BR generation works +Patch1: %{name}-deps.patch + +%description +%{desc} + +%package -n python3-%{pypi_name} +Summary: %{summary} +BuildRequires: gcc +BuildRequires: libzstd-devel +BuildRequires: python3-devel +%if %{with check} +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(pytest-xdist) +%endif +# https://github.com/indygreg/python-zstandard/issues/48 +Provides: bundled(zstd) = 1.5.6 + +%description -n python3-%{pypi_name} +%{desc} + +%pyproject_extras_subpkg -n python3-%{pypi_name} cffi + +%prep +%autosetup -p1 -n %{pypi_name}-%{version} +rm -r %{pypi_name}.egg-info + +%generate_buildrequires +%if %{with check} +%pyproject_buildrequires -x cffi -t +%else +%pyproject_buildrequires -x cffi +%endif + +%build +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files -l %{pypi_name} + +%check +%pyproject_check_import +%if %{with check} +mv zstandard{,.src} +export ZSTD_SLOW_TESTS=1 +%pytest -v\ + --numprocesses=auto +mv zstandard{.src,} +%endif + +%files -n python3-%{pypi_name} -f %{pyproject_files} +%license LICENSE zstd/COPYING +%doc README.rst + +%changelog +* Sun Jan 05 2025 Arkady L. Shane - 0.23.0-1 +- Rebuilt for MSVSphere 10 + +* Thu Oct 03 2024 Dominik Mierzejewski - 0.23.0-1 +- update to 0.23.0 (resolves rhbz#2298052) +- switch to modern python packaging guidelines + and automatic BuildRequires generation + +* Fri Jul 19 2024 Fedora Release Engineering - 0.22.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Fri Jun 07 2024 Python Maint - 0.22.0-4 +- Rebuilt for Python 3.13 + +* Fri Jan 26 2024 Fedora Release Engineering - 0.22.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 0.22.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Nov 22 2023 Dominik Mierzejewski - 0.22.0-1 +- update to 0.22.0 (resolves rhbz#2247527) +- fix build with Python 3.13 (resolves rhbz#2245876) + +* Fri Jul 21 2023 Fedora Release Engineering - 0.21.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jun 15 2023 Python Maint - 0.21.0-2 +- Rebuilt for Python 3.12 + +* Wed May 24 2023 Dominik Mierzejewski - 0.21.0-1 +- update to 0.21.0 (#2172363) +- bump bundled zstd version + +* Fri Jan 20 2023 Fedora Release Engineering - 0.19.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Wed Nov 02 2022 Dominik Mierzejewski 0.19.0-1 +- update to 0.19.0 (#2138646) + +* Wed Oct 05 2022 Dominik Mierzejewski 0.18.0-1 +- update to 0.18.0 (#2099853) + +* Fri Jul 22 2022 Fedora Release Engineering - 0.17.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue Jun 14 2022 Python Maint - 0.17.0-2 +- Rebuilt for Python 3.11 + +* Tue Feb 15 2022 Dominik Mierzejewski 0.17.0-1 +- update to 0.17.0 (#2042593) +- drop obsolete patch + +* Fri Jan 21 2022 Fedora Release Engineering - 0.16.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Oct 18 2021 Dominik Mierzejewski 0.16.0-1 +- update to 0.16.0 (#2014873) +- drop obsolete patch +- improve patch for inconsistent `closed` attribute issue + +* Tue Jul 27 2021 Fedora Release Engineering - 0.15.2-3 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 0.15.2-2 +- Rebuilt for Python 3.10 + +* Mon Mar 01 2021 Dominik Mierzejewski 0.15.2-1 +- update to 0.15.2 (#1933476) +- fix tests on s390x + +* Wed Feb 03 2021 Dominik Mierzejewski 0.15.1-1 +- update to 0.15.1 (#1924620) +- work around weird test failure +- fix tests on i686 and s390x + +* Wed Jan 27 2021 Fedora Release Engineering - 0.13.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 0.13.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri May 29 2020 Dominik Mierzejewski 0.13.0-1 +- initial build +- skip some tests on s390x (https://github.com/indygreg/python-zstandard/issues/105) +