4841b0d
%global commit fdd42e838e4d5199b0277fc21a920a744cdd5c9d
4d7ab8b
de3c2fa
Name:           python-ruamel-yaml-clib
4841b0d
Version:        0.2.7
57b88ff
Release:        6%{?dist}
72bcb8d
Summary:        C version of reader, parser and emitter for ruamel.yaml derived from libyaml
72bcb8d
8bbacc3
# SPDX
72bcb8d
License:        MIT
0b72a58
URL:            https://sourceforge.net/projects/ruamel-yaml-clib
a8b60c2
Source0:        https://sourceforge.net/code-snapshots/hg/r/ru/ruamel-yaml-clib/code/ruamel-yaml-clib-code-%{commit}.zip
a8b60c2
# Include license file for bundled libyaml
a8b60c2
# https://sourceforge.net/p/ruamel-yaml-clib/tickets/16/
a8b60c2
# This should be fixed upstream in a future ruamel.yaml.clib release >0.2.7
a8b60c2
Source1:        https://github.com/yaml/libyaml/raw/0.1.7/LICENSE#/LICENSE-libyaml
57b88ff
Patch1:         fix-typecasts-s390x.patch
72bcb8d
72bcb8d
BuildRequires:  gcc
72bcb8d
cf62192
%global _description %{expand:
cf62192
It is the C based reader/scanner and emitter for ruamel.yaml.}
cf62192
cf62192
%description %{_description}
72bcb8d
de3c2fa
%package -n     python3-ruamel-yaml-clib
72bcb8d
Summary:        %{summary}
cf62192
72bcb8d
BuildRequires:  python3-devel
cf62192
BuildRequires:  %{py3_dist Cython}
72bcb8d
279b580
# Unfortunately, the circular dependency is intentional; the clib extension
279b580
# packaged here imports from ruamel.yaml, which in turn uses the extension for
279b580
# performance.
7e7f124
BuildRequires:  python3-ruamel-yaml
ede8688
Requires:       python3-ruamel-yaml
72bcb8d
a8b60c2
# Bundled sources from libyaml are:
a8b60c2
#   - config.h yaml.h yaml_private.h
a8b60c2
#   - api.c dumper.c emitter.c loader.c parser.c reader.c scanner.c writer.c
a8b60c2
#
a8b60c2
# Support building with an external/system copy of libyaml?
a8b60c2
# https://sourceforge.net/p/ruamel-yaml-clib/tickets/15/
a8b60c2
#
a8b60c2
# Upstream replied:
a8b60c2
#
a8b60c2
#   The copy is because there have been improvements where libyaml had not been
a8b60c2
#   maintained for several years. But that is minor reason to do that, as I am
a8b60c2
#   working on an alternative for clib.
a8b60c2
#
a8b60c2
# Version number from VERSION in config.h:
a8b60c2
Provides:       bundled(libyaml) = 0.1.7
a8b60c2
cf62192
%py_provides python3-ruamel.yaml.clib
cf62192
cf62192
%description -n python3-ruamel-yaml-clib %{_description}
72bcb8d
72bcb8d
%prep
57b88ff
%autosetup -p1 -n ruamel-yaml-clib-code-%{commit}
4d7ab8b
# Force regenerating C files from Cython sources
4d7ab8b
rm -v $(grep -rl '/\* Generated by Cython')
a8b60c2
cp -p '%{SOURCE1}' .
72bcb8d
cf62192
%generate_buildrequires
cf62192
# Upstream has a tox.ini, but it is for a build-and-install check, not a test
cf62192
# suite, so we do not use it to generate dependencies (-t).
cf62192
%pyproject_buildrequires
cf62192
72bcb8d
%build
f307e2c
# cython refuses to cythonize a file in a directory that cannot be a Python
f307e2c
# module ¯\_(ツ)_/¯
f307e2c
#
f307e2c
# Top-level structure seems to be incompatible with Cython 0.29.34
f307e2c
# ('ruamel-yaml-clib-code._ruamel_yaml' is not a valid module name)
f307e2c
# https://sourceforge.net/p/ruamel-yaml-clib/tickets/14/
4d7ab8b
mkdir ruamel.yaml.clib
4d7ab8b
mv *.pyx ruamel.yaml.clib
6d0cc70
cythonize -3 ruamel.yaml.clib/*.pyx
4d7ab8b
mv ruamel.yaml.clib/* .
4d7ab8b
rmdir ruamel.yaml.clib
4d7ab8b
cf62192
%pyproject_wheel
72bcb8d
72bcb8d
%install
cf62192
%pyproject_install
cf62192
%pyproject_save_files _ruamel_yaml
72bcb8d
7e7f124
%check
7e7f124
%py3_check_import _ruamel_yaml
7e7f124
cf62192
%files -n python3-ruamel-yaml-clib -f %{pyproject_files}
cf62192
# pyproject_files handles LICENSE; verify with “rpm -qL -p …”
cf62192
# Remove the following once we no longer have a separate LICENSE-libyaml:
a8b60c2
%license LICENSE LICENSE-libyaml
cf62192
72bcb8d
%doc README.rst
72bcb8d
72bcb8d
%changelog
57b88ff
* Thu Feb 01 2024 Florian Weimer <fweimer@redhat.com> - 0.2.7-6
57b88ff
- Update fix-typecasts-s390x.patch for GCC 14 compatibility (#2042422)
57b88ff
93291f1
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.7-5
93291f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
93291f1
f63b06d
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.7-4
f63b06d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
f63b06d
a8a99c5
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.7-3
a8a99c5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
a8a99c5
a4ce089
* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 0.2.7-2
a4ce089
- Rebuilt for Python 3.12
a4ce089
4841b0d
* Wed May 03 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.2.7-1
4841b0d
- Update to 0.2.7
4841b0d
8bbacc3
* Wed May 03 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.2.6-5
8bbacc3
- Confirm License is SPDX MIT
de3c2fa
- Reduce macro indirection, etc.
68ed5ad
- Drop unused manual runtime dependency on setuptools
279b580
- Add a note about the circular dependency with ruamel.yaml
a9345a7
- Stop numbering sources and patches
0b72a58
- Update URL (close RHBZ#1840610)
7e7f124
- Add an import-only “smoke test”
a8b60c2
- Properly handle libyaml bundling
cf62192
- Port to pyproject-rpm-macros (“new Python guidelines”)
f307e2c
- Add a link to the upstream issue for the Cython workaround
8bbacc3
fd87b73
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-4
fd87b73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
fd87b73
b0b38e8
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-3
b0b38e8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
b0b38e8
bff2c34
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.2.6-2
bff2c34
- Rebuilt for Python 3.11
bff2c34
6d0cc70
* Tue May 10 2022 Jakub Čajka <jcajka@redhat.com> - 0.2.6-1
6d0cc70
- Update to 0.2.6
6d0cc70
- Fix for type demotion issues on s390x
6d0cc70
- Resolves: BZ#2042422
6d0cc70
62e1459
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-9
62e1459
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
62e1459
66c7836
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-8
66c7836
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
66c7836
f2bcaea
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.1.2-7
f2bcaea
- Rebuilt for Python 3.10
f2bcaea
f3f133c
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-6
f3f133c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
f3f133c
4d7ab8b
* Thu Nov 12 2020 Miro Hrončok <mhroncok@redhat.com> - 0.1.2-5
4d7ab8b
- Force regenerating C files from Cython sources
ede8688
- Require python3-ruamel-yaml
4d7ab8b
0be3240
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-4
0be3240
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
0be3240
d6a5d70
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.1.2-3
d6a5d70
- Rebuilt for Python 3.9
d6a5d70
218834d
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-2
218834d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
218834d
72bcb8d
* Fri Aug 30 2019 Chandan Kumar <raukadah@gmail.com> - 0.1.2-1
72bcb8d
- Initial package