diff --git a/.gitignore b/.gitignore index f237789..fc79ea3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /libdeflater-1.19.0.crate /libdeflater-1.19.2.crate /libdeflater-1.19.3.crate +/libdeflater-1.20.0.crate diff --git a/libdeflater-fix-metadata.diff b/libdeflater-fix-metadata.diff deleted file mode 100644 index 06df28e..0000000 --- a/libdeflater-fix-metadata.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- libdeflater-1.19.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ libdeflater-1.19.3/Cargo.toml 2024-03-11T14:44:03.719963+00:00 -@@ -32,6 +32,7 @@ - ] - license = "Apache-2.0" - repository = "https://github.com/adamkewley/libdeflater" -+exclude = ["/scripts"] - - [[bench]] - name = "benchmarks" -@@ -43,9 +44,6 @@ - [dev-dependencies.adler32] - version = "1.2.0" - --[dev-dependencies.criterion] --version = "0.3" -- - [dev-dependencies.flate2] - version = "1.0.11" - diff --git a/rust-libdeflater.spec b/rust-libdeflater.spec index 7112d64..c5f7068 100644 --- a/rust-libdeflater.spec +++ b/rust-libdeflater.spec @@ -5,20 +5,19 @@ %global crate libdeflater Name: rust-libdeflater -Version: 1.19.3 +Version: 1.20.0 Release: %autorelease Summary: Bindings to libdeflate for DEFLATE License: Apache-2.0 URL: https://crates.io/crates/libdeflater Source: %{crates_source} -# Manually created patch for downstream crate metadata changes -# * Do not depend on criterion; it is needed only for benchmarks. -# * Exclude the scripts directory to avoid generating an unwanted and -# unnecessary dependency on ruby from the -devel subpackage -Patch: libdeflater-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 +# Do downstream crate metadata changes programmatically in %%prep. Since %%prep +# runs before %%generate_buildrequires, we must add the following manually +# rather than generating a dynamic BuildRequires via rust2rpm.toml. +BuildRequires: tomcli %global _description %{expand: Bindings to libdeflate for DEFLATE (de)compression exposed as non- @@ -93,6 +92,8 @@ use the "use_rust_alloc" feature of the "%{crate}" crate. %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep +# Do not depend on criterion; it is needed only for benchmarks. +tomcli set Cargo.toml del dev-dependencies.criterion %generate_buildrequires %cargo_generate_buildrequires diff --git a/rust2rpm.toml b/rust2rpm.toml index 1781693..5eee6c1 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,5 +1,5 @@ -[package] -cargo-toml-patch-comments = [ - "Do not depend on criterion; it is needed only for benchmarks.", - "Exclude the scripts directory to avoid generating an unwanted and unnecessary dependency on ruby from the -devel subpackage", +[scripts.prep] +post = [ + "# Do not depend on criterion; it is needed only for benchmarks.", + "tomcli set Cargo.toml del dev-dependencies.criterion", ] diff --git a/sources b/sources index 047a1b4..445d687 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libdeflater-1.19.3.crate) = b6bd4c8cb7d56771f92fd1491fec2a8a7cb1493b3e86866bd5e029c9b8a55fbc343433a5ae6f575adbb0774767aa7224e714d3db27b14557683e2ffb97e2a4c6 +SHA512 (libdeflater-1.20.0.crate) = 763ae07856284a8353a441bd335bcb0ec55200c03a5924aa7d25b083fa05a7d887d747688d6e0e01ca8fd90480fcb3463c55b94a274f257bace11da792cf87af