From e3a06478acb761b44e8ec95d1886524e82c12430 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Fri, 25 Nov 2022 15:24:06 +0100 Subject: [PATCH] Initial import (#2143685) --- .gitignore | 1 + LICENSE | 29 +++++++++++++++ README.md | 3 -- bindgen-cli-fix-metadata.diff | 10 +++++ rust-bindgen-cli.spec | 69 +++++++++++++++++++++++++++++++++++ sources | 1 + 6 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 LICENSE delete mode 100644 README.md create mode 100644 bindgen-cli-fix-metadata.diff create mode 100644 rust-bindgen-cli.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4adc29b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bindgen-cli-0.62.0.crate diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..62f55f4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2013, Jyun-Yan You +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md deleted file mode 100644 index b1340be..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# rust-bindgen-cli - -The rust-bindgen-cli package diff --git a/bindgen-cli-fix-metadata.diff b/bindgen-cli-fix-metadata.diff new file mode 100644 index 0000000..cfb1d4b --- /dev/null +++ b/bindgen-cli-fix-metadata.diff @@ -0,0 +1,10 @@ +--- bindgen-cli-0.62.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ bindgen-cli-0.62.0/Cargo.toml 2022-11-17T13:46:15.720565+00:00 +@@ -55,7 +55,6 @@ + [features] + default = [ + "logging", +- "runtime", + "which-rustfmt", + ] + logging = [ diff --git a/rust-bindgen-cli.spec b/rust-bindgen-cli.spec new file mode 100644 index 0000000..4bf7f1e --- /dev/null +++ b/rust-bindgen-cli.spec @@ -0,0 +1,69 @@ +# Generated by rust2rpm 23 +%bcond_without check + +%global crate bindgen-cli + +Name: rust-bindgen-cli +Version: 0.62.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 +Source0: %{crates_source} +# https://github.com/rust-lang/rust-bindgen/pull/2352 +Source1: https://github.com/rust-lang/rust-bindgen/raw/v0.62.0/LICENSE +# Manually created patch for downstream crate metadata changes +# * default to linking with libclang instead of using dlopen +Patch: bindgen-cli-fix-metadata.diff + +BuildRequires: rust-packaging >= 23 + +%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-DFS-2016 +# Apache-2.0 +# Apache-2.0 OR MIT +# BSD-3-Clause +# ISC +# MIT +# MIT OR Apache-2.0 +# Unlicense OR MIT +License: BSD-3-Clause AND Apache-2.0 AND ISC and MIT AND Unicode-DFS-2016 +# LICENSE.dependencies contains a full license breakdown + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%license LICENSE.dependencies +%doc README.md +%{_bindir}/bindgen + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +cp -pav %{SOURCE1} . +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build +%{cargo_license} > LICENSE.dependencies + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..9c0ea43 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (bindgen-cli-0.62.0.crate) = c0e5404f6d46ad80ec18f2ee36fa9d70af859bf82e26dae1dddbe324d40feb826c4abc05b6a0b3a66878280115e316e54bed82af153c06e3c53b32842ce74523