File ryzen_smu.spec of Package ryzen_smu

#
# spec file for package ryzen_smu
#
# Copyright (c) 2022, Martin Hauke <mardnh@gmx.de>
#
# 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 http://bugs.opensuse.org/
#


Name:           ryzen_smu
Version:        1686941344.e61177d
Release:        0%{?dist}
Summary:        A linux driver that exposes access to the SMU for AMD Ryzen processors
License:        GPL-2.0-only
Group:          System/Monitoring
URL:            https://gitlab.com/leogx9r/ryzen_smu
#Git-Clone:     https://gitlab.com/leogx9r/ryzen_smu.git
Source:         %{name}-%{version}.tar.xz
Source1:        preamble
BuildRequires:  %{kernel_module_package_buildreqs}
%kernel_module_package -p %{_sourcedir}/preamble
ExclusiveArch:  x86_64

%description
Ryzen SMU is a Linux kernel driver that exposes access to the SMU (System
Management Unit) for certain AMD Ryzen Processors.

%package tools
Summary:        Ryzen SMU userspace sensor
Group:          System/Monitoring
Provides:       monitor_cpu

%description tools
Ryzen SMU userspace sensor.

%prep
%setup -q

set -- *
mkdir source
mv "$@" source/
mkdir obj

%build
for flavor in %{flavors_to_build}; do
  cp -r source obj/$flavor
  %make_build -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor
done

# build monitor_cpu
cd source/userspace
%make_build

%install
export INSTALL_MOD_PATH=%{buildroot}
for flavor in %{flavors_to_build}; do
  make V=1 -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor
done

# install monitor_cpu
install -Dm 0755 source/userspace/monitor_cpu %{buildroot}%{_bindir}/monitor_cpu

%files tools
%license source/LICENSE
%doc source/README.md
%{_bindir}/monitor_cpu

%changelog
openSUSE Build Service is sponsored by