From 14a90fd114c8bfdb0a3d7509c8bb203e9b443c9b Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Wed, 2 Oct 2024 17:01:09 +0200 Subject: [PATCH] Drop example program that pulls in clap ^2 --- fern-fix-metadata.diff | 22 ++++++++++++++++++++++ rust-fern.spec | 11 ++++++++--- rust2rpm.conf | 12 ------------ rust2rpm.toml | 25 +++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 fern-fix-metadata.diff delete mode 100644 rust2rpm.conf create mode 100644 rust2rpm.toml diff --git a/fern-fix-metadata.diff b/fern-fix-metadata.diff new file mode 100644 index 0000000..13cae60 --- /dev/null +++ b/fern-fix-metadata.diff @@ -0,0 +1,22 @@ +--- fern-0.6.2/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ fern-0.6.2/Cargo.toml 2024-10-02T14:59:20.417715+00:00 +@@ -39,9 +39,6 @@ + + [package.metadata.docs.rs] + all-features = true +- +-[[example]] +-name = "cmd-program" + + [[example]] + name = "date-based-file-log" +@@ -86,9 +83,6 @@ + [dependencies.log] + version = "0.4" + features = ["std"] +- +-[dev-dependencies.clap] +-version = "2.22" + + [dev-dependencies.humantime] + version = "2.1.0" diff --git a/rust-fern.spec b/rust-fern.spec index 3d3836a..59ae11d 100644 --- a/rust-fern.spec +++ b/rust-fern.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 24 +# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} @@ -12,8 +12,11 @@ Summary: Simple, efficient logging License: MIT URL: https://crates.io/crates/fern Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +# * drop example-only dependency on clap ^2 +Patch: fern-fix-metadata.diff -BuildRequires: rust-packaging >= 21 +BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: Simple, efficient logging.} @@ -109,8 +112,10 @@ use the "meta-logging-in-format" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep +# drop one example program that pulls in clap ^2 +rm examples/cmd-program.rs %generate_buildrequires %cargo_generate_buildrequires diff --git a/rust2rpm.conf b/rust2rpm.conf deleted file mode 100644 index 741a946..0000000 --- a/rust2rpm.conf +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -unwanted-features = - reopen03 - reopen1 - reopen-03 - reopen-1 - syslog3 - syslog4 - syslog6 - syslog-3 - syslog-4 - syslog-6 diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..0f89003 --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,25 @@ +[package] +cargo-toml-patch-comments = [ + "drop example-only dependency on clap ^2", +] + +[features] +hide = [ + "reopen03", + "reopen1", + "reopen-03", + "reopen-1", + "syslog3", + "syslog4", + "syslog6", + "syslog-3", + "syslog-4", + "syslog-6", +] + +[scripts] +prep.post = [ + "# drop one example program that pulls in clap ^2", + "rm examples/cmd-program.rs", +] +