diff --git a/.gitignore b/.gitignore index e69de29..36313e6 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/bindgen-cli-0.72.0.crate +/bindgen-cli-0.72.0-vendor.tar.xz diff --git a/rust-bindgen-cli.spec b/rust-bindgen-cli.spec new file mode 100644 index 0000000..0f57efa --- /dev/null +++ b/rust-bindgen-cli.spec @@ -0,0 +1,90 @@ +%bcond check 1 + +%global crate bindgen-cli + +Name: rust-bindgen-cli +Version: 0.72.0 +Release: %autorelease +Summary: Automatically generates Rust FFI bindings to C and C++ libraries + +License: BSD-3-Clause +URL: https://crates.io/crates/bindgen-cli +Source: %{crates_source} + +# vendor tarball is generated by running: +# tar xf bindgen-cli-%%{version}.crate +# pushd bindgen-cli-%%{version} +# cargo vendor-filterer --versioned-dirs \ +# --platform={aarch64,i686,powerpc64le,s390x,x86_64}-unknown-linux-gnu +# tar --sort=name -Jcvf ../bindgen-cli-%%{version}-vendor.tar.xz vendor/ +# popd +Source1: bindgen-cli-%{version}-vendor.tar.xz + +BuildRequires: rust-toolset + +%global _description %{expand: +Automatically generates Rust FFI bindings to C and C++ libraries.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +# (MIT OR Apache-2.0) AND Unicode-3.0 +# Apache-2.0 +# Apache-2.0 OR MIT +# BSD-3-Clause +# ISC +# MIT +# MIT OR Apache-2.0 +# Unlicense OR MIT +License: %{shrink: + BSD-3-Clause AND + Apache-2.0 AND + ISC AND + MIT AND + Unicode-3.0 AND + (Apache-2.0 OR MIT) AND + (Unlicense OR MIT) +} +# LICENSE.dependencies contains a full license breakdown + +# /usr/bin/bindgen was moved from bindgen to bindgen-cli with v0.61 +Provides: bindgen = %{version}-%{release} +Obsoletes: bindgen < 0.61 + +# /usr/bin/bindgen requires libclang.so at runtime +Requires: clang-libs +# We also need it to run `bindgen` library tests. +BuildRequires: clang-libs + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%license LICENSE.dependencies +%license cargo-vendor.txt +%doc README.md +%{_bindir}/bindgen + +%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 +# Run the library tests since we're not packaging that separately. +%{cargo_test} --package bindgen +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..c168138 --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (bindgen-cli-0.72.0.crate) = 96f9a0d012f81facb9802525693cdf8e8bff5888c22d98723fdb6dc78a743786d870bfb13daab0dda7e15ddceb8c0d09f2ae5f4e73042cd7594741f0ca7c9966 +SHA512 (bindgen-cli-0.72.0-vendor.tar.xz) = 2fdce35746d6c0f106dc639589743cca9726d6d10835ba2e627aaf830d229931bf4c97d8c3154e10debc2b3d090f9708a75639b0b7a08130e969d136c33bd79a