From eaf945676fdaebb78a054f24412237db3471419e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 10 Dec 2024 13:59:45 -0500 Subject: [PATCH] Initial package (close RHBZ#2328493) --- .gitignore | 1 + rust-writeable.rpmlintrc | 4 ++ rust-writeable.spec | 97 +++++++++++++++++++++++++++++++++++++ rust2rpm.toml | 15 ++++++ sources | 1 + writeable-fix-metadata.diff | 9 ++++ 6 files changed, 127 insertions(+) create mode 100644 .gitignore create mode 100644 rust-writeable.rpmlintrc create mode 100644 rust-writeable.spec create mode 100644 rust2rpm.toml create mode 100644 sources create mode 100644 writeable-fix-metadata.diff diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..860c7d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/writeable-0.5.5.crate diff --git a/rust-writeable.rpmlintrc b/rust-writeable.rpmlintrc new file mode 100644 index 0000000..d08cac6 --- /dev/null +++ b/rust-writeable.rpmlintrc @@ -0,0 +1,4 @@ +# Feature metapackages are not supposed to have documentation! +addFilter(r"\+[-_\w]+-devel.noarch: W: no-documentation") +# Not a real spelling error (from fmt::Display) +addFilter(r" spelling-error \('(fmt)',") diff --git a/rust-writeable.spec b/rust-writeable.spec new file mode 100644 index 0000000..4f57365 --- /dev/null +++ b/rust-writeable.spec @@ -0,0 +1,97 @@ +# Generated by rust2rpm 26 +%bcond_without check +%global debug_package %{nil} + +%global crate writeable + +Name: rust-writeable +Version: 0.5.5 +Release: %autorelease +Summary: More efficient alternative to fmt::Display + +License: Unicode-3.0 +URL: https://crates.io/crates/writeable +Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +# * Drop benchmark-only criterion dependency +Patch: writeable-fix-metadata.diff + +BuildRequires: cargo-rpm-macros >= 24 + +%global _description %{expand: +A more efficient alternative to fmt::Display.} + +%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}+bench-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+bench-devel %{_description} + +This package contains library source intended for building other packages which +use the "bench" feature of the "%{crate}" crate. + +%files -n %{name}+bench-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+either-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+either-devel %{_description} + +This package contains library source intended for building other packages which +use the "either" feature of the "%{crate}" crate. + +%files -n %{name}+either-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version} -p1 +# Avoid a dependency on the internal icu_benchmark_macros crate +rm -rv examples/ +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..e5b67e8 --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,15 @@ +[package] +cargo-toml-patch-comments = [ + # This would be a candidate for automated patching with tomcli if it were + # an unconditional dependency, but given it is + # target.'cfg(not(target_arch = \"wasm32\"))', manual patching is easier. + "Drop benchmark-only criterion dependency", + # Starting with writeable 0.6: + # "Omit removed examples from Cargo.toml", +] + +[scripts.prep] +pre = [ + "# Avoid a dependency on the internal icu_benchmark_macros crate", + "rm -rv examples/", +] diff --git a/sources b/sources new file mode 100644 index 0000000..195ac16 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (writeable-0.5.5.crate) = 818b2546c8ec25816aeaf5e31a1ded927d197bf7256e7c5073738c2709bc58a95d382a0256eb38a99235ae83729b578701261866d42ea3357a26024906e196c1 diff --git a/writeable-fix-metadata.diff b/writeable-fix-metadata.diff new file mode 100644 index 0000000..7b46a2e --- /dev/null +++ b/writeable-fix-metadata.diff @@ -0,0 +1,9 @@ +--- writeable-0.5.5/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ writeable-0.5.5/Cargo.toml 2024-11-28T00:58:01.883029+00:00 +@@ -58,6 +58,3 @@ + [features] + bench = [] + either = ["dep:either"] +- +-[target."cfg(not(target_arch = \"wasm32\"))".dev-dependencies.criterion] +-version = "0.5.0"