%global debug_package %{nil} %define github_project LenovoLegionLinux %define github_archive_name 61f05e082afe2af9fec3d038e8c800192b2de07f Name: legion-laptop-kmod Version: 0.0.18 Release: 3 Summary: Lenovo Legion laptop driver kernel module Group: System Environment/Kernel License: GPL-2.0 URL: https://github.com/johnfanv2/%{github_project} Source0: %{url}/archive/%{github_archive_name}.tar.gz ExclusiveArch: x86_64 BuildRequires: %{_bindir}/kmodtool # kmodtool does its magic here %define kmodtool_args --target %{_target_cpu} --kmodname %{name} --%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:akmod} %{?kernels:--for-kernels "%{?kernels}"} %{echo: Executing kmodtool %{kmodtool_args}} %{expand:%(kmodtool %{kmodtool_args} 2>/dev/null || echo %%{error: kmodtool failed}) } %description Driver for controlling Lenovo Legion laptops including fan control and power mode. %package -n %{name}-common Summary: Lenovo Legion laptop driver kernel module common files (empty package for kmodtool compatibility) BuildArch: noarch %description -n %{name}-common %{summary} %files -n %{name}-common %prep # error out if there was something wrong with kmodtool %{?kmodtool_check} %autosetup -c -n %{github_archive_name} for kernel_version in %{?kernel_versions} ; do cp -a %{github_project}-%{github_archive_name}/kernel_module _kmod_build_${kernel_version%%___*} done %build for kernel_version in %{?kernel_versions}; do make -C ${kernel_version##*___} M=${PWD}/_kmod_build_${kernel_version%%___*} modules done %install for kernel_version in %{?kernel_versions}; do install -D -m 755 _kmod_build_${kernel_version%%___*}/legion-laptop.ko ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/legion-laptop.ko done %{?akmod_install} %clean rm -rf $RPM_BUILD_ROOT %changelog * Sun Oct 20 2024 Alexander Solstad Larsen 0.0.18-2 - Include fix for newer kernels (fixed akmod build) * Sun Oct 20 2024 Alexander Solstad Larsen 0.0.18-2 - Include fix for newer kernels * Mon Aug 26 2024 Alexander Solstad Larsen 0.0.18-1 - Initial build.