commit fb7ebbd55cac19c3727aa8d96c6fbca8862cb1ed Author: Sergey Cherevko Date: Thu Jul 18 12:55:58 2024 +0300 import python-pyzstd-0.15.10-1.el9 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..63cbd20 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/pyzstd-0.15.10.tar.gz diff --git a/.python-pyzstd.metadata b/.python-pyzstd.metadata new file mode 100644 index 0000000..917cb25 --- /dev/null +++ b/.python-pyzstd.metadata @@ -0,0 +1 @@ +0a548fd4d24f7fcc018e9d49de9a621bc3c63967 SOURCES/pyzstd-0.15.10.tar.gz diff --git a/SOURCES/README.md b/SOURCES/README.md new file mode 100644 index 0000000..808a080 --- /dev/null +++ b/SOURCES/README.md @@ -0,0 +1,3 @@ +# python-pyzstd + +The python-pyzstd package diff --git a/SOURCES/config_settings-fix.patch b/SOURCES/config_settings-fix.patch new file mode 100644 index 0000000..a2cb40e --- /dev/null +++ b/SOURCES/config_settings-fix.patch @@ -0,0 +1,30 @@ +From 467bd72ad4caadc1b006fc913452b3598c369b73 Mon Sep 17 00:00:00 2001 +From: Maxwell G +Date: Sun, 7 Apr 2024 00:29:36 +0000 +Subject: [PATCH] pyzstd_pep517: name config_settings argument correctly + +Ref: https://peps.python.org/pep-0517/#get-requires-for-build-wheel +--- + build_script/pyzstd_pep517.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/build_script/pyzstd_pep517.py b/build_script/pyzstd_pep517.py +index cea7c94..7b4b3f8 100644 +--- a/build_script/pyzstd_pep517.py ++++ b/build_script/pyzstd_pep517.py +@@ -1,10 +1,10 @@ + from setuptools import build_meta as _orig + from setuptools.build_meta import * + +-def get_requires_for_build_wheel(cfg=None): ++def get_requires_for_build_wheel(config_settings=None): + requires = [] +- if isinstance(cfg, dict) and '--build-option' in cfg: +- v = cfg['--build-option'] ++ if isinstance(config_settings, dict) and '--build-option' in config_settings: ++ v = config_settings['--build-option'] + if isinstance(v, (str, list)) and '--cffi' in v: + requires.append('cffi') +- return _orig.get_requires_for_build_wheel(cfg) + requires +\ No newline at end of file ++ return _orig.get_requires_for_build_wheel(config_settings) + requires diff --git a/SPECS/python-pyzstd.spec b/SPECS/python-pyzstd.spec new file mode 100644 index 0000000..8bd0737 --- /dev/null +++ b/SPECS/python-pyzstd.spec @@ -0,0 +1,75 @@ +%bcond tests 1 +%global forgeurl https://github.com/Rogdham/pyzstd +%define tag %{version} + +Name: python-pyzstd +Version: 0.15.10 +%forgemeta +Release: 1%{?dist} +Summary: Python bindings to Zstandard (zstd) compression library + +License: BSD-3-Clause +URL: %{forgeurl} +Source: %{forgesource} +# pyzstd_pep517: name config_settings argument correctly (#2) +# pyproject-rpm-macros' config_settings support passes it as a kwarg +Patch: %{url}/pull/2.patch#/config_settings-fix.patch + +BuildRequires: gcc +BuildRequires: python3-devel +BuildRequires: libzstd-devel +%if %{with tests} +BuildRequires: %{py3_dist pytest} +%endif + +%global _description %{expand: +Pyzstd module provides classes and functions for compressing and decompressing +data, using Facebook’s Zstandard (or zstd as short name) algorithm.} + +%description %_description + + +%package -n python3-pyzstd +Summary: %{summary} + +%description -n python3-pyzstd %_description + + +%prep +%autosetup -p1 %{forgesetupargs} +# Ensure dynamic-link-zstd is always used +sed -i 's|DYNAMIC_LINK =.*|DYNAMIC_LINK = True|' setup.py +# Stop disabling debuginfo +sed -i "s|'-g0', ||" setup.py +# Fix non-executable-script rpmlint error +sed -i -e '1{\@^#!.*@d}' src/__main__.py + + +%generate_buildrequires +%pyproject_buildrequires + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files pyzstd + + +%check +%pytest + + +%files -n python3-pyzstd -f %{pyproject_files} +%doc README.rst +%license LICENSE + + +%changelog +* Thu Jul 18 2024 Sergey Cherevko - 0.15.10-1 +- Rebuilt for MSVSphere 9.4 + +* Sun Apr 07 2024 Maxwell G - 0.15.10-1 +- Initial package (rhbz#2273823).