commit 81a015f0cdbe5de9c23ca91d497e0c5b9844d0db Author: MSVSphere Packaging Team Date: Fri Oct 25 18:52:20 2024 +0300 import python-ruamel-yaml-clib-0.2.7-7.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3959729 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/ruamel-yaml-clib-code-fdd42e838e4d5199b0277fc21a920a744cdd5c9d.zip diff --git a/.python-ruamel-yaml-clib.metadata b/.python-ruamel-yaml-clib.metadata new file mode 100644 index 0000000..3e5045f --- /dev/null +++ b/.python-ruamel-yaml-clib.metadata @@ -0,0 +1 @@ +ff23dd8a8266f256987fc42e1d7e88260409efc6 SOURCES/ruamel-yaml-clib-code-fdd42e838e4d5199b0277fc21a920a744cdd5c9d.zip diff --git a/SOURCES/LICENSE-libyaml b/SOURCES/LICENSE-libyaml new file mode 100644 index 0000000..050ced2 --- /dev/null +++ b/SOURCES/LICENSE-libyaml @@ -0,0 +1,19 @@ +Copyright (c) 2006 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/SOURCES/fix-typecasts-s390x.patch b/SOURCES/fix-typecasts-s390x.patch new file mode 100644 index 0000000..a206278 --- /dev/null +++ b/SOURCES/fix-typecasts-s390x.patch @@ -0,0 +1,74 @@ +diff --git a/_ruamel_yaml.pxd b/_ruamel_yaml.pxd +index d8dc3c6bdaa27055..9e63ba7e4be3e4af 100644 +--- a/_ruamel_yaml.pxd ++++ b/_ruamel_yaml.pxd +@@ -1,16 +1,16 @@ + + cdef extern from "_ruamel_yaml.h": + +- void malloc(int l) +- void memcpy(char *d, char *s, int l) +- int strlen(char *s) ++ void malloc(size_t l) ++ void memcpy(void *d, const void *s, size_t l) ++ size_t strlen(const char *s) + int PyString_CheckExact(object o) + int PyUnicode_CheckExact(object o) + char *PyString_AS_STRING(object o) +- int PyString_GET_SIZE(object o) +- object PyString_FromStringAndSize(char *v, int l) +- object PyUnicode_FromString(char *u) +- object PyUnicode_DecodeUTF8(char *u, int s, char *e) ++ Py_ssize_t PyString_GET_SIZE(object o) ++ object PyString_FromStringAndSize(char *v, Py_ssize_t l) ++ object PyUnicode_FromString(const char *u) ++ object PyUnicode_DecodeUTF8(const char *u, size_t s, const char *e) + object PyUnicode_AsUTF8String(object o) + int PY_MAJOR_VERSION + +@@ -85,11 +85,11 @@ cdef extern from "_ruamel_yaml.h": + YAML_MAPPING_START_EVENT + YAML_MAPPING_END_EVENT + +- ctypedef int yaml_read_handler_t(void *data, char *buffer, +- int size, int *size_read) except 0 ++ ctypedef int yaml_read_handler_t(void *data, unsigned char *buffer, ++ size_t size, size_t *size_read) except 0 + +- ctypedef int yaml_write_handler_t(void *data, char *buffer, +- int size) except 0 ++ ctypedef int yaml_write_handler_t(void *data, unsigned char *buffer, ++ size_t size) except 0 + + ctypedef struct yaml_mark_t: + int index +diff --git a/_ruamel_yaml.pyx b/_ruamel_yaml.pyx +index 4fd50e207b8d5100..20a796a30662c890 100644 +--- a/_ruamel_yaml.pyx ++++ b/_ruamel_yaml.pyx +@@ -904,7 +904,7 @@ cdef class CParser: + raise error + return 1 + +-cdef int input_handler(void *data, char *buffer, int size, int *read) except 0: ++cdef int input_handler(void *data, unsigned char *buffer, size_t size, size_t *read) except 0: + cdef CParser parser + parser = data + if parser.stream_cache is None: +@@ -1514,13 +1514,13 @@ cdef class CEmitter: + self.ascend_resolver() + return 1 + +-cdef int output_handler(void *data, char *buffer, int size) except 0: ++cdef int output_handler(void *data, unsigned char *buffer, size_t size) except 0: + cdef CEmitter emitter + emitter = data + if emitter.dump_unicode == 0: +- value = PyString_FromStringAndSize(buffer, size) ++ value = PyString_FromStringAndSize(buffer, size) + else: +- value = PyUnicode_DecodeUTF8(buffer, size, 'strict') ++ value = PyUnicode_DecodeUTF8(buffer, size, 'strict') + emitter.stream.write(value) + return 1 + diff --git a/SPECS/python-ruamel-yaml-clib.spec b/SPECS/python-ruamel-yaml-clib.spec new file mode 100644 index 0000000..ce92ee6 --- /dev/null +++ b/SPECS/python-ruamel-yaml-clib.spec @@ -0,0 +1,174 @@ +%global commit fdd42e838e4d5199b0277fc21a920a744cdd5c9d + +Name: python-ruamel-yaml-clib +Version: 0.2.7 +Release: 7%{?dist} +Summary: C version of reader, parser and emitter for ruamel.yaml derived from libyaml + +# SPDX +License: MIT +URL: https://sourceforge.net/projects/ruamel-yaml-clib +Source0: https://sourceforge.net/code-snapshots/hg/r/ru/ruamel-yaml-clib/code/ruamel-yaml-clib-code-%{commit}.zip +# Include license file for bundled libyaml +# https://sourceforge.net/p/ruamel-yaml-clib/tickets/16/ +# This should be fixed upstream in a future ruamel.yaml.clib release >0.2.7 +Source1: https://github.com/yaml/libyaml/raw/0.1.7/LICENSE#/LICENSE-libyaml +Patch1: fix-typecasts-s390x.patch + +BuildRequires: gcc + +%global _description %{expand: +It is the C based reader/scanner and emitter for ruamel.yaml.} + +%description %{_description} + +%package -n python3-ruamel-yaml-clib +Summary: %{summary} + +BuildRequires: python3-devel +BuildRequires: %{py3_dist Cython} + +# Unfortunately, the circular dependency is intentional; the clib extension +# packaged here imports from ruamel.yaml, which in turn uses the extension for +# performance. +BuildRequires: python3-ruamel-yaml +Requires: python3-ruamel-yaml + +# Bundled sources from libyaml are: +# - config.h yaml.h yaml_private.h +# - api.c dumper.c emitter.c loader.c parser.c reader.c scanner.c writer.c +# +# Support building with an external/system copy of libyaml? +# https://sourceforge.net/p/ruamel-yaml-clib/tickets/15/ +# +# Upstream replied: +# +# The copy is because there have been improvements where libyaml had not been +# maintained for several years. But that is minor reason to do that, as I am +# working on an alternative for clib. +# +# Version number from VERSION in config.h: +Provides: bundled(libyaml) = 0.1.7 + +%py_provides python3-ruamel.yaml.clib + +%description -n python3-ruamel-yaml-clib %{_description} + +%prep +%autosetup -p1 -n ruamel-yaml-clib-code-%{commit} +# Force regenerating C files from Cython sources +rm -v $(grep -rl '/\* Generated by Cython') +cp -p '%{SOURCE1}' . + +%generate_buildrequires +# Upstream has a tox.ini, but it is for a build-and-install check, not a test +# suite, so we do not use it to generate dependencies (-t). +%pyproject_buildrequires + +%build +# cython refuses to cythonize a file in a directory that cannot be a Python +# module ¯\_(ツ)_/¯ +# +# Top-level structure seems to be incompatible with Cython 0.29.34 +# ('ruamel-yaml-clib-code._ruamel_yaml' is not a valid module name) +# https://sourceforge.net/p/ruamel-yaml-clib/tickets/14/ +mkdir ruamel.yaml.clib +mv *.pyx ruamel.yaml.clib +cythonize -3 ruamel.yaml.clib/*.pyx +mv ruamel.yaml.clib/* . +rmdir ruamel.yaml.clib + +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files _ruamel_yaml + +%check +%py3_check_import _ruamel_yaml + +%files -n python3-ruamel-yaml-clib -f %{pyproject_files} +# pyproject_files handles LICENSE; verify with “rpm -qL -p …” +# Remove the following once we no longer have a separate LICENSE-libyaml: +%license LICENSE LICENSE-libyaml + +%doc README.rst + +%changelog +* Fri Oct 25 2024 MSVSphere Packaging Team - 0.2.7-7 +- Rebuilt for MSVSphere 10 + +* Mon Jun 24 2024 Troy Dawson - 0.2.7-7 +- Bump release for June 2024 mass rebuild + +* Thu Feb 01 2024 Florian Weimer - 0.2.7-6 +- Update fix-typecasts-s390x.patch for GCC 14 compatibility (#2042422) + +* Fri Jan 26 2024 Fedora Release Engineering - 0.2.7-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 0.2.7-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 0.2.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jun 14 2023 Python Maint - 0.2.7-2 +- Rebuilt for Python 3.12 + +* Wed May 03 2023 Benjamin A. Beasley - 0.2.7-1 +- Update to 0.2.7 + +* Wed May 03 2023 Benjamin A. Beasley - 0.2.6-5 +- Confirm License is SPDX MIT +- Reduce macro indirection, etc. +- Drop unused manual runtime dependency on setuptools +- Add a note about the circular dependency with ruamel.yaml +- Stop numbering sources and patches +- Update URL (close RHBZ#1840610) +- Add an import-only “smoke test” +- Properly handle libyaml bundling +- Port to pyproject-rpm-macros (“new Python guidelines”) +- Add a link to the upstream issue for the Cython workaround + +* Fri Jan 20 2023 Fedora Release Engineering - 0.2.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 0.2.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 0.2.6-2 +- Rebuilt for Python 3.11 + +* Tue May 10 2022 Jakub Čajka - 0.2.6-1 +- Update to 0.2.6 +- Fix for type demotion issues on s390x +- Resolves: BZ#2042422 + +* Fri Jan 21 2022 Fedora Release Engineering - 0.1.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 0.1.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 0.1.2-7 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 0.1.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Nov 12 2020 Miro Hrončok - 0.1.2-5 +- Force regenerating C files from Cython sources +- Require python3-ruamel-yaml + +* Wed Jul 29 2020 Fedora Release Engineering - 0.1.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue May 26 2020 Miro Hrončok - 0.1.2-3 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.1.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Aug 30 2019 Chandan Kumar - 0.1.2-1 +- Initial package