From 4183493db7cfb08cdd4c9c30bfe5e140940751e0 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 9 Jul 2025 14:31:13 -0700 Subject: [PATCH] Initial commit on c10s Resolves: RHEL-91175 --- .gitignore | 2 ++ cbindgen.spec | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 2 ++ 3 files changed, 92 insertions(+) create mode 100644 cbindgen.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..77a68e9 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/cbindgen-0.29.0.crate +/cbindgen-0.29.0-vendor.tar.xz diff --git a/cbindgen.spec b/cbindgen.spec new file mode 100644 index 0000000..03cbfc7 --- /dev/null +++ b/cbindgen.spec @@ -0,0 +1,88 @@ +%bcond check 1 + +# prevent library files from being installed +%global cargo_install_lib 0 + +%global crate cbindgen + +# This is forked from Fedora's rust-cbindgen, shipping only the command-line +# binary, not any of the library -devel packages. We've renamed the source +# so Fedora EPEL can continue shipping its devel packages without conflict. +Name: cbindgen +Version: 0.29.0 +Release: %autorelease +Summary: Tool for generating C bindings to Rust code + +# (MIT OR Apache-2.0) AND Unicode-DFS-2016 +# Apache-2.0 OR BSL-1.0 +# Apache-2.0 OR MIT +# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +# MIT +# MIT OR Apache-2.0 +# MPL-2.0 +# Unlicense OR MIT +License: %{shrink: + MPL-2.0 AND + MIT AND + Unicode-DFS-2016 AND + (Apache-2.0 OR BSL-1.0) AND + (Apache-2.0 OR MIT) AND + (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND + (Unlicense OR MIT) +} +# LICENSE.dependencies contains a full license breakdown + +URL: https://crates.io/crates/cbindgen +Source: %{crates_source} + +# vendor tarball is generated by running: +# tar xf cbindgen-%%{version}.crate +# pushd cbindgen-%%{version} +# cargo vendor-filterer --versioned-dirs \ +# --platform={aarch64,i686,powerpc64le,s390x,x86_64}-unknown-linux-gnu +# tar --sort=name -Jcvf ../cbindgen-%%{version}-vendor.tar.xz vendor/ +# popd +Source1: cbindgen-%{version}-vendor.tar.xz + +BuildRequires: rust-toolset +%if %{with check} +BuildRequires: /usr/bin/cython +BuildRequires: /usr/bin/gcc +BuildRequires: /usr/bin/g++ +%endif + +%global _description %{expand: +A tool for generating C bindings to Rust code.} + +%description %{_description} + +%files +%license LICENSE +%license LICENSE.dependencies +%license cargo-vendor.txt +%doc README.md +%doc contributing.md +%doc docs.md +%doc internals.md +%{_bindir}/cbindgen + +%prep +%autosetup -n %{crate}-%{version} -p1 -a1 +%cargo_prep -v vendor + +%build +%cargo_build +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies +%{cargo_vendor_manifest} + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..80d65af --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (cbindgen-0.29.0.crate) = fa2816881b376e3cc9ce61f9ee982438b38224fdd7225a41131e2500395d75e09b596840fb75f8ffcc04d7a9f90be02c2256918fe33f377660c1d78a3f89a1ac +SHA512 (cbindgen-0.29.0-vendor.tar.xz) = 57e5a08c8db9afab29daeba172e2a80dc694ee6de5a4752b919cda65720c236dd789ce77bb022bf74726420eeb8018ccfe67de9e408a38775ae1c3c690fac247