From b207e90249f32cfa988260a976bc12d824f384a3 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 14 Mar 2024 11:41:37 -0400 Subject: [PATCH] Use rust2rpm 26 features to reduce the amount of manual packaging work --- rust-zopfli.spec | 12 ++++++------ rust2rpm.toml | 10 +++++++++- zopfli-fix-metadata.diff | 24 +----------------------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/rust-zopfli.spec b/rust-zopfli.spec index ae0f7da..6aee402 100644 --- a/rust-zopfli.spec +++ b/rust-zopfli.spec @@ -1,7 +1,10 @@ -# Generated by rust2rpm 25 +# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} +# prevent executables from being installed +%global cargo_install_bin 0 + %global crate zopfli Name: rust-zopfli @@ -13,14 +16,11 @@ License: Apache-2.0 URL: https://crates.io/crates/zopfli Source: %{crates_source} # Manually created patch for downstream crate metadata changes -# -# - Don’t build the “zopfli” executable, which would conflict with the more -# widely used one provided by https://src.fedoraproject.org/rpms/zopfli. -# - Exclude more files from the published crate +# * Exclude more files from the published crate: # https://github.com/zopfli-rs/zopfli/pull/37 Patch: zopfli-fix-metadata.diff -BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: cargo-rpm-macros >= 26 %global _description %{expand: A Rust implementation of the Zopfli compression algorithm.} diff --git a/rust2rpm.toml b/rust2rpm.toml index 2ce769f..3dcb1ac 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,4 +1,12 @@ +[package] +# Don’t build the “zopfli” executable, which would conflict with the more +# widely used one provided by https://src.fedoraproject.org/rpms/zopfli. +cargo-install-bin = false +cargo-toml-patch-comments = [ + "Exclude more files from the published crate: https://github.com/zopfli-rs/zopfli/pull/37", +] + [features] hide = [ - "nightly" + "nightly", ] diff --git a/zopfli-fix-metadata.diff b/zopfli-fix-metadata.diff index e78f837..d11d55e 100644 --- a/zopfli-fix-metadata.diff +++ b/zopfli-fix-metadata.diff @@ -1,5 +1,5 @@ --- zopfli-0.8.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zopfli-0.8.0/Cargo.toml 2024-02-08T17:20:25.311181+00:00 ++++ zopfli-0.8.0/Cargo.toml 2024-03-14T15:41:14.859061+00:00 @@ -14,7 +14,12 @@ rust-version = "1.66" name = "zopfli" @@ -14,25 +14,3 @@ description = "A Rust implementation of the Zopfli compression algorithm." homepage = "https://github.com/zopfli-rs/zopfli" readme = "README.md" -@@ -25,20 +30,13 @@ - ] - license = "Apache-2.0" - repository = "https://github.com/zopfli-rs/zopfli" -+autobins = false - - [package.metadata.docs.rs] - cargo-args = ["--all-features"] - - [profile.release] - debug = 2 -- --[[bin]] --name = "zopfli" --required-features = [ -- "std", -- "gzip", -- "zlib", --] - - [dependencies.crc32fast] - version = "1.3.2"