From a704379583136584204e1e61940d73116b85c57c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 21 Sep 2024 13:41:03 -0400 Subject: [PATCH] Initial package (close RHBZ#2311985) --- .gitignore | 1 + ...ignore-an-example-that-would-depend-.patch | 26 ++++ rust-yoke.rpmlintrc | 2 + rust-yoke.spec | 123 ++++++++++++++++++ rust2rpm.toml | 29 +++++ sources | 1 + 6 files changed, 182 insertions(+) create mode 100644 .gitignore create mode 100644 0001-Downstream-only-ignore-an-example-that-would-depend-.patch create mode 100644 rust-yoke.rpmlintrc create mode 100644 rust-yoke.spec create mode 100644 rust2rpm.toml create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7726105 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/yoke-0.7.4.crate diff --git a/0001-Downstream-only-ignore-an-example-that-would-depend-.patch b/0001-Downstream-only-ignore-an-example-that-would-depend-.patch new file mode 100644 index 0000000..b49aacc --- /dev/null +++ b/0001-Downstream-only-ignore-an-example-that-would-depend-.patch @@ -0,0 +1,26 @@ +From 8c94cbb25bcc53be90448f0202b6b32046bd302b Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Thu, 12 Sep 2024 11:09:01 -0400 +Subject: [PATCH] Downstream-only: ignore an example that would depend on the + postcard crate + +--- + src/yoke.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/yoke.rs b/src/yoke.rs +index eaad9e073..d55396b6a 100644 +--- a/src/yoke.rs ++++ b/src/yoke.rs +@@ -158,7 +158,7 @@ where + /// + /// Write the number of consumed bytes to a local variable: + /// +- /// ``` ++ /// ```ignore + /// # use yoke::Yoke; + /// # use std::rc::Rc; + /// # use std::borrow::Cow; +-- +2.46.0 + diff --git a/rust-yoke.rpmlintrc b/rust-yoke.rpmlintrc new file mode 100644 index 0000000..0244557 --- /dev/null +++ b/rust-yoke.rpmlintrc @@ -0,0 +1,2 @@ +# Feature metapackages are not supposed to have documentation! +addFilter(r"\+[-_\w]+-devel.noarch: W: no-documentation") diff --git a/rust-yoke.spec b/rust-yoke.spec new file mode 100644 index 0000000..c096b07 --- /dev/null +++ b/rust-yoke.spec @@ -0,0 +1,123 @@ +# Generated by rust2rpm 26 +%bcond_without check +%global debug_package %{nil} + +%global crate yoke + +Name: rust-yoke +Version: 0.7.4 +Release: %autorelease +Summary: Abstraction allowing borrowed data to be carried along with its backing data + +License: Unicode-3.0 +URL: https://crates.io/crates/yoke +Source: %{crates_source} +# * Downstream-only: ignore an example that would depend on the postcard crate: +# it is not worth packaging this merely to compile an example. +Patch10: 0001-Downstream-only-ignore-an-example-that-would-depend-.patch + +BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: tomcli + +%global _description %{expand: +Abstraction allowing borrowed data to be carried along with the backing +data it borrows from.} + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel %{_description} + +This package contains library source intended for building other packages which +use the "%{crate}" crate. + +%files devel +%license %{crate_instdir}/LICENSE +%doc %{crate_instdir}/README.md +%{crate_instdir}/ + +%package -n %{name}+default-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+default-devel %{_description} + +This package contains library source intended for building other packages which +use the "default" feature of the "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+alloc-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+alloc-devel %{_description} + +This package contains library source intended for building other packages which +use the "alloc" feature of the "%{crate}" crate. + +%files -n %{name}+alloc-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+derive-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+derive-devel %{_description} + +This package contains library source intended for building other packages which +use the "derive" feature of the "%{crate}" crate. + +%files -n %{name}+derive-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+serde-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+serde-devel %{_description} + +This package contains library source intended for building other packages which +use the "serde" feature of the "%{crate}" crate. + +%files -n %{name}+serde-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+zerofrom-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+zerofrom-devel %{_description} + +This package contains library source intended for building other packages which +use the "zerofrom" feature of the "%{crate}" crate. + +%files -n %{name}+zerofrom-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep +# Do not depend on postcard; it is needed only for one (patched-out) example. +tomcli set Cargo.toml del dev-dependencies.postcard + +%generate_buildrequires +%cargo_generate_buildrequires -f derive + +%build +%cargo_build -f derive + +%install +%cargo_install -f derive + +%if %{with check} +%check +%cargo_test -f derive +%endif + +%changelog +%autochangelog diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..171a56a --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,29 @@ +[package] +summary = "Abstraction allowing borrowed data to be carried along with its backing data" + +[features] +# Some features are needed for tests. +enable = [ + "derive", +] + +[requires] +build = [ + "tomcli", +] + +[scripts.prep] +post = [ + "# Do not depend on postcard; it is needed only for one (patched-out) example.", + "tomcli set Cargo.toml del dev-dependencies.postcard", +] + +[[package.extra-patches]] +number = 10 +file = "0001-Downstream-only-ignore-an-example-that-would-depend-.patch" +comments = [ + """\ + Downstream-only: ignore an example that would depend on the postcard \ + crate: it is not worth packaging this merely to compile an example.\ + """ +] diff --git a/sources b/sources new file mode 100644 index 0000000..8109482 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (yoke-0.7.4.crate) = b3d1456e28d53723470644ae15a4298fa96a79593d90729221ca4e45a6f09de4d7c554703425c61595c4e78959652122db95865c0337cc0cd6a4ec57d7bea84d