python-ruamel-yaml-clib/python-ruamel-yaml-clib.spec
2023-05-03 14:01:21 -04:00

134 lines
4.7 KiB
RPMSpec

%global commit 85e484db2b7c37107e4edd2ae6fc380877bbc08e
Name: python-ruamel-yaml-clib
Version: 0.2.6
Release: 5%{?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
Patch: fix-typecasts-s390x.patch
BuildRequires: gcc
%description
It is the C based reader/scanner and emitter for ruamel.yaml.
%package -n python3-ruamel-yaml-clib
Summary: %{summary}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-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
%description -n python3-ruamel-yaml-clib
It is the C based reader/scanner and emitter for ruamel.yaml.
%prep
%autosetup -n ruamel-yaml-clib-code-%{commit}
# Force regenerating C files from Cython sources
rm -v $(grep -rl '/\* Generated by Cython')
cp -p '%{SOURCE1}' .
%build
# cython refuses to cythonize a file in a directory that cannot be a Python module ¯\_(ツ)_/¯
mkdir ruamel.yaml.clib
mv *.pyx ruamel.yaml.clib
cythonize -3 ruamel.yaml.clib/*.pyx
mv ruamel.yaml.clib/* .
rmdir ruamel.yaml.clib
%py3_build
%install
%{python3} setup.py install --single-version-externally-managed --skip-build --root $RPM_BUILD_ROOT
%check
%py3_check_import _ruamel_yaml
%files -n python3-ruamel-yaml-clib
%license LICENSE LICENSE-libyaml
%doc README.rst
%{python3_sitearch}/_ruamel_yaml.cpython-*
%{python3_sitearch}/ruamel.yaml.clib-%{version}-py%{python3_version}.egg-info
%changelog
* Wed May 03 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 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
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.2.6-2
- Rebuilt for Python 3.11
* Tue May 10 2022 Jakub Čajka <jcajka@redhat.com> - 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 <releng@fedoraproject.org> - 0.1.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.1.2-7
- Rebuilt for Python 3.10
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Nov 12 2020 Miro Hrončok <mhroncok@redhat.com> - 0.1.2-5
- Force regenerating C files from Cython sources
- Require python3-ruamel-yaml
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.1.2-3
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Aug 30 2019 Chandan Kumar <raukadah@gmail.com> - 0.1.2-1
- Initial package