# Generated by rust2rpm 25 %bcond_without check %global debug_package %{nil} %global crate lz4 Name: rust-lz4 Version: 1.24.0 Release: %autorelease Summary: Rust LZ4 bindings library License: MIT URL: https://crates.io/crates/lz4 Source: %{crates_source} # Manually created patch for downstream crate metadata changes # # - Don’t build the “lz4” executable, which would conflict with the more widely # used one provided by https://src.fedoraproject.org/rpms/lz4. # - Drop the docmatic dependency because we do not want to run README tests: # first, they fail with a cryptic error, # # test README.md - lz4::Usage (line 24) ... FAILED # # failures: # # ---- README.md - lz4::Usage (line 24) stdout ---- # error[E0464]: multiple candidates for `rlib` dependency `lz4` found # --> README.md:25:1 # | # 2 | extern crate lz4; # | ^^^^^^^^^^^^^^^^^ # | # = note: candidate #1: /builddir/build/BUILD/lz4-1.24.0/target/rpm/deps/liblz4-430954c2cc8582cf.rlib # = note: candidate #2: /builddir/build/BUILD/lz4-1.24.0/target/rpm/deps/liblz4-f0150d90d55664ca.rlib # # and second, they don’t seem useful enough to struggle with the above. # Advice is welcome. Patch: lz4-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: Rust LZ4 bindings library.} %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}/CHANGELOG.md %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 %prep %autosetup -n %{crate}-%{version} -p1 # Remove the docmatic test; see notes above lz4-fix-metadata.diff. rm tests/docmatic.rs %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %install %cargo_install %if %{with check} %check %cargo_test %endif %changelog %autochangelog