%if 0%{?fedora} %global buildforkernels akmod %global debug_package %{nil} %endif %global prjname acpi_ec %global gitabbrev e83e5a6 %global gitdate 20240914 %global rel %{gitdate}git%{gitabbrev} Name: %{prjname}-kmod Summary: Kernel module (kmod) for %{prjname} Version: 1.0.4 Release: 1%{?rel:.%{rel}}%{?dist} License: GPLv2+ URL: https://github.com/musikid/acpi_ec Source0: %{url}/archive/v%{version}/%{prjname}-%{version}%{?rel:-%{rel}}.tar.gz BuildRequires: gcc BuildRequires: elfutils-libelf-devel BuildRequires: kmodtool # kmodtool does its magic here %{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{prjname} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description %{prjname} 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} --repo rpmfusion --kmodname %{prjname} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null %setup -q -c for kernel_version in %{?kernel_versions} ; do cp -a %{prjname} _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/%{prjname}.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/*.ko done %{?akmod_install} %changelog * Tue Oct 15 2024 Andrea Santilli - 1.0.4-20240914gite83e5a6 - Update to commit e83e5a6122e15a83cc52883ac24bf9b1880fd53c (version 1.0.4) * Thu Jan 05 2023 Andrea Santilli - 1.0.2-20221210git80a31d7 - Initial akmod RPM release.