File amdgpu_top.spec of Package amdgpu_top
#
# spec file for package amdgpu_top
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: amdgpu_top
Version: 0.10.1
Release: 0
Summary: Tool to display AMDGPU usage
License: MIT
URL: https://github.com/Umio-Yasuno/amdgpu_top
Source0: %{name}-%{version}.tar.zst
Source1: vendor.tar.zst
BuildRequires: cargo-packaging
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libdrm_amdgpu)
# Needed to properly install desktop files
BuildRequires: update-desktop-files
%description
amdgpu_top is tool that display AMD GPU utilization, like umr or clbr/radeontop
or intel_gpu_top. The tool displays information gathered from performance
counters (GRBM, GRBM2), sensors, fdinfo, and AMDGPU driver.
%prep
# The number passed to -a (a stands for "after") should be equivalent to the Source tag number
# of the vendor tarball, 1 in this case (from Source1).
%autosetup -a1
%build
%{cargo_build}
%install
%{cargo_install} --locked
%{__install} -Dm 0644 docs/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
%{__install} -Dm 0644 assets/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
%{__install} -Dm 0644 assets/%{name}-tui.desktop %{buildroot}%{_datadir}/applications/%{name}-tui.desktop
%suse_update_desktop_file %{name}
%suse_update_desktop_file %{name}-tui
%files
%license LICENSE
%doc README.md docs/*.md
%{_bindir}/amdgpu_top
%{_mandir}/man1/%{name}.1%{?ext_man}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/%{name}-tui.desktop
%changelog