# Generated by rust2rpm 27 %bcond check 1 %global crate du-dust Name: du-dust Version: 1.2.1 Release: %autorelease Summary: More intuitive version of du License: Apache-2.0 URL: https://crates.io/crates/du-dust Source: %{crates_source} # Automatically generated patch to strip dependencies and normalize metadata Patch: du-dust-fix-metadata-auto.diff # Manually created patch for downstream crate metadata changes Patch: du-dust-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: A more intuitive version of du.} %description %{_description} %files -n %{crate} %license LICENSE %license LICENSE.dependencies %doc README.md %{_bindir}/dust %prep %autosetup -n %{crate}-%{version} -p1 sed -i 's|use sysinfo::{System, SystemExt};|use sysinfo::System;|' src/main.rs #sysinfo changed some syntax, patch source code to match these changes sed -i 's|let mut system = System::new();|let system = System::new();|' src/main.rs sed -i 's|system.refresh_all();|System::refresh_all(\&system);|' src/main.rs sed -i 's|for disk in system.disks()|for disk in System::disks(\&system)|' src/main.rs %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install %cargo_install %if %{with check} %check %cargo_test %endif %changelog %autochangelog