%bcond check 1 %global crate amdgpu_top Name: amdgpu_top Version: 0.11.2 Release: %autorelease Summary: Tool to displays AMDGPU usage gathered from performance counters License: MIT URL: https://github.com/Umio-Yasuno/amdgpu_top.git Source0: %{url}/archive/v%{version}/%{crate}-%{version}.tar.gz Source1: amdgpu_top-%{version}-vendor.tar.xz BuildRequires: cargo-rpm-macros >= 24 BuildRequires: libdrm-devel BuildRequires: libX11-devel BuildRequires: wayland-devel %global _description %{expand: Tool to displays AMDGPU usage. The tool displays information gathered from performance counters (GRBM, GRBM2), sensors, fdinfo, gpu_metrics and AMDGPU driver.} %description %{_description} %prep %autosetup -n %{crate}-%{version} -p1 -a1 %cargo_prep -v vendor # Add Git replacement config for the vendored dependencies cat >> .cargo/config.toml << EOF [source."https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs"] git = "https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs" rev = "02aec00249416c762122bdff582fe6ce5053a4ce" replace-with = "vendored-sources" EOF %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %{cargo_vendor_manifest} %install # Manual installation of the binary to bypass git vendor bugs during cargo install install -Dpm 0755 target/rpm/amdgpu_top %{buildroot}%{_bindir}/amdgpu_top %if %{with check} %check %cargo_test %endif %files %license LICENSE %license LICENSE.dependencies %license cargo-vendor.txt %doc AUTHORS %doc CHANGELOG.md %doc README.md %{_bindir}/amdgpu_top %changelog %autochangelog