%if 0%{?fedora} %global buildforkernels akmod %global debug_package %{nil} %endif Name: acpi_ec-kmod Version: 1.0.4 Release: 9%{?dist} Summary: Kernel module for interfacing with the ACPI Embedded Controller. License: GPLv3 URL: https://github.com/musikid/acpi_ec Source: %{url}/archive/refs/tags/v%{version}.tar.gz BuildRequires: kmodtool %{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description acpi_ec is a simple kernel module which takes most of its code from "ec_sys.c" and provides a simple interface between the ACPI embedded controller and the userspace. Its main intent is to be used with [NoteBook Fan Control](https://github.com/hirschmann/nbfc) but you can of course install it for another purpose. You can access to the EC simply by read/write to `/dev/ec`. %prep # error out if there was something wrong with kmodtool %{?kmodtool_check} # print kmodtool output for debugging purposes: kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null %setup -q -c acpi_ec-%{version} for kernel_version in %{?kernel_versions} ; do cp -a acpi_ec-%{version} _kmod_build_${kernel_version%%___*} done %build for kernel_version in %{?kernel_versions} ; do make V=1 %{?_smp_mflags} -C ${kernel_version##*___} M=${PWD}/_kmod_build_${kernel_version%%___*} modules done %install for kernel_version in %{?kernel_versions}; do mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ install -D -m 755 _kmod_build_${kernel_version%%___*}/src/acpi_ec.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/acpi_ec.ko done %{?akmod_install} %changelog