%bcond check 1 %global crate amdgpu_top Name: amdgpu_top Version: 0.11.4 Release: %autorelease Summary: Tool to displays AMDGPU usage gathered from performance counters # Main project: MIT # Vendored dependencies have varying licenses, see LICENSE.dependencies for more details. License: MIT AND Apache-2.0 AND (MIT OR Apache-2.0) AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR GPL-2.0-only) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (BSD-3-Clause OR Apache-2.0) AND (BSD-3-Clause OR MIT OR Apache-2.0) AND BSL-1.0 AND CC0-1.0 AND ISC AND (MIT OR Apache-2.0 OR LGPL-2.1-or-later) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT) AND Zlib AND Unicode-3.0 AND OFL-1.1 AND Ubuntu-font-1.0 URL: https://github.com/Umio-Yasuno/amdgpu_top.git Source0: %{url}/archive/v%{version}/%{crate}-%{version}.tar.gz # To generate the vendor tarball: # wget https://github.com/Umio-Yasuno/amdgpu_top/archive/refs/tags/v%{version}.tar.gz -O amdgpu_top-%{version}.tar.gz # tar -xf amdgpu_top-%{version}.tar.gz # cd amdgpu_top-%{version} # cargo vendor # tar -cJf ../amdgpu_top-%{version}-vendor.tar.xz vendor/ 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."git+https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs?rev=5f4d7ea6d4d51b2536ac7605a4c325cac15bdfd9"] git = "https://github.com/Umio-Yasuno/libdrm-amdgpu-sys-rs" rev = "7714cb3f810342d22c56154cf8501d072759709a" 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