Package from a GitHub archive, with data/ filtered out

This commit is contained in:
Benjamin A. Beasley 2025-07-19 08:00:28 -04:00
commit bcfbf082b2
4 changed files with 57 additions and 69 deletions

View file

@ -35,74 +35,15 @@ Summary: Fast, correct Python JSON library
# - src/serialize/writer/str/mod.rs
# - src/serialize/writer/str/sse2.rs
License: (Apache-2.0 OR MIT) AND Apache-2.0%{?with_yyjson: AND MIT}
%if %{without yyjson}
# Additionally, the following are removed in %%prep and do not contribute to
# the licenses of the binary RPMs:
#
# Apache-2.0 WITH LLVM-exception:
# - include/cargo/target-lexicon-*/
#
# BSL-1.0:
# - include/cargo/xxhash-rust-*/
#
# MIT:
%if %{without yyjson}
# - include/yyjson/yyjson.c
# - include/yyjson/yyjson.h
%endif
# - include/cargo/crunchy-*/
# - include/cargo/itoap-*/
#
# MIT OR Apache-2.0:
# - include/cargo/associative-cache-*/
# - include/cargo/bytecount-*/
# - include/cargo/cc-*/
# - include/cargo/cfg-if-*/
# - include/cargo/gimli-*/
# - include/cargo/half-*/
# - include/cargo/itoa-*/
# - include/cargo/libc-*/
# - include/cargo/once_cell-*/
# - include/cargo/portable-atomic-*/
# - include/cargo/portable-atomic-util-*/
# - include/cargo/proc-macro2-*/
# - include/cargo/pyo3-build-config-*/
# - include/cargo/pyo3-ffi-*/
# - include/cargo/quote-*/
# - include/cargo/serde-*/
# - include/cargo/serde_derive-*/
# - include/cargo/serde_json-*/
# - include/cargo/shlex-*/
# - include/cargo/simdutf8-*/
# - include/cargo/smallvec-*/
# - include/cargo/syn-*/
# - include/cargo/unwinding-*/
# - include/cargo/uuid-*/
# - include/cargo/version_check-*/
#
# Apache-2.0 OR BSL-1.0:
# - include/cargo/ryu-*/
#
# (Apache-2.0 OR MIT) AND BSD-3-Clause:
# - include/cargo/encoding_rs-*/
#
# (MIT OR Apache-2.0) AND Unicode-3.0:
# - include/cargo/unicode-ident-*/
#
# Unlicense OR MIT:
# - include/cargo/jiff-*/
# - include/cargo/jiff-static-*/
# - include/cargo/memchr-*/
SourceLicense: %{shrink:
(Apache-2.0 OR MIT) AND
Apache-2.0 AND
Apache-2.0 WITH LLVM-exception AND
BSD-3-Clause AND
BSL-1.0 AND
MIT AND
Unicode-3.0 AND
(Apache-2.0 OR BSL-1.0)
(Unlicense OR MIT)
}
SourceLicense: (Apache-2.0 OR MIT) AND Apache-2.0 AND MIT
URL: https://github.com/ijl/orjson
# We must be careful about the source archive.
#
@ -110,7 +51,7 @@ URL: https://github.com/ijl/orjson
# which we would remove in %%prep, but which we must still check to make sure
# everything has a license acceptable for distribution in Fedora before
# uploading to the lookaside cache.
Source: %{pypi_source orjson}
# Source: %%{pypi_source orjson}
# The GitHub archives from
# %%{url}/archive/%%{version}/orjson-%%{version}.tar.gz do not have the
# vendored crates, but they contain benchmark data in data/, some of which is
@ -118,11 +59,10 @@ Source: %{pypi_source orjson}
# https://github.com/minimaxir/big-list-of-naughty-strings and should carry the
# corresponding MIT license text), and some of which looks like it might have
# at best unclear license status. Since the benchmark data is potentially
# problematic, we would need to filter the GitHub archives with a script; this
# hasnt been written yet, but could be similar to the one in python-cramjam.
# Source0: orjson-%%{version}-filtered.tar.gz
# problematic, we would need to filter the GitHub archives with a script.
Source0: orjson-%{version}-filtered.tar.xz
# ./get_source ${COMMIT} (or ${TAG})
# Source1: get_source
Source1: get_source
BuildRequires: tomcli
BuildRequires: python3-devel
@ -188,8 +128,6 @@ Provides: bundled(yyjson) = 0.9.0
# “Avoid bundling libgcc on musl.”
tomcli-set Cargo.toml del 'features.unwind'
tomcli-set Cargo.toml del 'dependencies.unwinding'
# Remove bundled rust crates
rm -r include/cargo
%if %{without yyjson}
# Remove bundled yyjson.
rm -rv include/yyjson/