diff --git a/.gitignore b/.gitignore index 8bb4c9d..b30024e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /zopfli-0.4.0.crate /zopfli-0.5.0.crate +/zopfli-0.8.0.crate diff --git a/rust-zopfli.spec b/rust-zopfli.spec index 1c5c6ea..f3d35b8 100644 --- a/rust-zopfli.spec +++ b/rust-zopfli.spec @@ -1,58 +1,45 @@ -# Generated by rust2rpm 20 +# Generated by rust2rpm 25 %bcond_without check +%global debug_package %{nil} %global crate zopfli -Name: rust-%{crate} -Version: 0.5.0 +Name: rust-zopfli +Version: 0.8.0 Release: %autorelease -Summary: Rust implementation of a compression algorithm +Summary: Rust implementation of the Zopfli compression algorithm -# Upstream license specification: Apache-2.0 -License: ASL 2.0 +License: Apache-2.0 URL: https://crates.io/crates/zopfli Source: %{crates_source} -# Initial patched metadata -# Downgrade typed-arena to version 1.7 -Patch0: zopfli-fix-metadata.diff +# 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. +Patch: zopfli-fix-metadata.diff -ExclusiveArch: %{rust_arches} - -BuildRequires: rust-packaging +BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: -Rust implementation of the Zopfli compression algorithm.} +A Rust implementation of the Zopfli compression algorithm.} %description %{_description} -%package -n %{crate} -Summary: %{summary} -# MIT -# MIT or ASL 2.0 -# Unlicense or MIT -# zlib -License: MIT and ASL 2.0 and Unlicense and zlib - -%description -n %{crate} %{_description} - -%files -n %{crate} -%license COPYING -%doc CONTRIBUTING.md CONTRIBUTORS README.md -%{_bindir}/zopfli - %package devel Summary: %{summary} BuildArch: noarch %description devel %{_description} -This package contains library source intended for building other packages -which use "%{crate}" crate. +This package contains library source intended for building other packages which +use the "%{crate}" crate. %files devel -%license COPYING -%doc CONTRIBUTING.md CONTRIBUTORS README.md -%{cargo_registry}/%{crate}-%{version_no_tilde}/ +%license %{crate_instdir}/COPYING +%doc %{crate_instdir}/CONTRIBUTING.md +%doc %{crate_instdir}/CONTRIBUTORS +%doc %{crate_instdir}/README.md +%{crate_instdir}/ %package -n %{name}+default-devel Summary: %{summary} @@ -61,13 +48,49 @@ BuildArch: noarch %description -n %{name}+default-devel %{_description} This package contains library source intended for building other packages which -use "default" feature of "%{crate}" crate. +use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+gzip-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+gzip-devel %{_description} + +This package contains library source intended for building other packages which +use the "gzip" feature of the "%{crate}" crate. + +%files -n %{name}+gzip-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+std-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+std-devel %{_description} + +This package contains library source intended for building other packages which +use the "std" feature of the "%{crate}" crate. + +%files -n %{name}+std-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+zlib-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+zlib-devel %{_description} + +This package contains library source intended for building other packages which +use the "zlib" feature of the "%{crate}" crate. + +%files -n %{name}+zlib-devel +%ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..2ce769f --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,4 @@ +[features] +hide = [ + "nightly" +] diff --git a/sources b/sources index a5255e9..41ac009 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zopfli-0.5.0.crate) = f8ea69c3aea08a53851e177e3579c46076271d28f6fe2da55ebd46a5f6d918afd084c0dc372313f4a06798ceb35adb577ce30bf272f273b842ba95172be3c9ec +SHA512 (zopfli-0.8.0.crate) = 3b788f0ca94a106ce690764d081bf277eddb364b07287c33be3855fdc63bd583b5e8aac95b709833b4ec4a8f153e7e1ea822b09da23d5db777137bc1dd49e17c diff --git a/zopfli-fix-metadata.diff b/zopfli-fix-metadata.diff index 487f6ef..8320e2f 100644 --- a/zopfli-fix-metadata.diff +++ b/zopfli-fix-metadata.diff @@ -1,8 +1,24 @@ ---- zopfli-0.5.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ zopfli-0.5.0/Cargo.toml 2022-01-17T22:21:57.128813+00:00 -@@ -35,4 +35,4 @@ - version = "2" +--- zopfli-0.8.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zopfli-0.8.0/Cargo.toml 2024-01-22T17:28:52.493168+00:00 +@@ -25,20 +25,13 @@ + ] + license = "Apache-2.0" + repository = "https://github.com/zopfli-rs/zopfli" ++autobins = false - [dependencies.typed-arena] --version = "2" -+version = "1.7" + [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"