From a8b60c242c50f6d671d4e609fd29cfffa7812ae0 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: May 03 2023 18:01:21 +0000 Subject: Properly handle libyaml bundling --- diff --git a/LICENSE-libyaml b/LICENSE-libyaml new file mode 100644 index 0000000..050ced2 --- /dev/null +++ b/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/python-ruamel-yaml-clib.spec b/python-ruamel-yaml-clib.spec index a38ca5e..e4dbf8e 100644 --- a/python-ruamel-yaml-clib.spec +++ b/python-ruamel-yaml-clib.spec @@ -8,11 +8,14 @@ Summary: C version of reader, parser and emitter for ruamel.yaml derived # SPDX License: MIT URL: https://sourceforge.net/projects/ruamel-yaml-clib -Source: https://sourceforge.net/code-snapshots/hg/r/ru/ruamel-yaml-clib/code/ruamel-yaml-clib-code-%{commit}.zip +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 -BuildRequires: libyaml-devel %description It is the C based reader/scanner and emitter for ruamel.yaml. @@ -29,6 +32,22 @@ BuildRequires: python3-Cython 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. @@ -36,6 +55,7 @@ It is the C based reader/scanner and emitter for ruamel.yaml. %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 ¯\_(ツ)_/¯ @@ -54,7 +74,7 @@ rmdir ruamel.yaml.clib %py3_check_import _ruamel_yaml %files -n python3-ruamel-yaml-clib -%license LICENSE +%license LICENSE LICENSE-libyaml %doc README.rst %{python3_sitearch}/_ruamel_yaml.cpython-* %{python3_sitearch}/ruamel.yaml.clib-%{version}-py%{python3_version}.egg-info @@ -68,6 +88,7 @@ rmdir ruamel.yaml.clib - 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 - 0.2.6-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild