File nct6687.spec of Package nct6687
#
# spec file for package nct6687
#
# Copyright (c) 2025 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/
#
%define git_version 20251024_15089b0
Name: nct6687
Summary: Linux kernel module for Nuvoton NCT6687-R
Version: 0.1.git%{git_version}
Release: 0
Url: https://github.com/Fred78290/nct6687d
Source0: nct6687-%{git_version}.tar.gz
License: GPL-2.0
Group: System/Kernel
BuildRequires: %{kernel_module_package_buildreqs}
%kernel_module_package -n %{name}
%description
This kernel module permit to recognize the chipset Nuvoton NCT6687-R
in lm-sensors package.
This sensor is present on some B550 motherboard such as MSI or ASUS.
The implementation is minimalist and was done by reverse coding of
Windows 10 source code from LibreHardwareMonitor.
%package load
Summary: Linux kernel module for Nuvoton NCT6687-R
Group: System/Kernel
Requires: %{name}-kmp = %{version}
BuildArch: noarch
%description load
This kernel module permit to recognize the chipset Nuvoton NCT6687-R
in lm-sensors package.
This sensor is present on some B550 motherboard such as MSI or ASUS.
The implementation is minimalist and was done by reverse coding of
Windows 10 source code from LibreHardwareMonitor.
With this package kernel module %{name} is loaded on boot.
%package doc
Summary: Documentation for %{name}
Group: System/Kernel
Requires: %{name}-kmp = %{version}
BuildArch: noarch
%description doc
This kernel module permit to recognize the chipset Nuvoton NCT6687-R
in lm-sensors package.
This sensor is present on some B550 motherboard such as MSI or ASUS.
The implementation is minimalist and was done by reverse coding of
Windows 10 source code from LibreHardwareMonitor.
With this package kernel module %{name} is loaded on boot.
%prep
%autosetup -p1 -n %{name}-%{git_version}
set -- *
mkdir source
mv "$@" source/
mkdir obj
%build
for flavor in %{flavors_to_build}; do
rm -rf obj/$flavor
cp -r source obj/$flavor
make V=1 %{?_smp_mflags} -C %{kernel_source $flavor} %{?linux_make_arch} modules M=$PWD/obj/$flavor
done
%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
for flavor in %{flavors_to_build}
do
%{__make} -C %{kernel_source $flavor} M=$PWD/obj/$flavor modules_install
done
mkdir -p %{buildroot}%{_prefix}/lib/modules-load.d/
cat <<EOF >%{buildroot}%{_prefix}/lib/modules-load.d/%{name}.conf
%{name}
EOF
%files load
%dir %{_prefix}/lib/modules-load.d
%{_prefix}/lib/modules-load.d/%{name}.conf
%files doc
%doc source/README.md source/sensors.d/*.conf
%license source/LICENSE
%changelog