%if 0%{?fedora} %global buildforkernels akmod %global debug_package %{nil} %endif Name: gpd-fan-kmod Version: 0.0.git.26.e49e1ffa Release: 1%{?dist} Summary: Driver to control fans on various GPD devices License: GPLv2 URL: https://github.com/Cryolitia/gpd-fan-driver VCS: git+https://github.com/KyleGospo/gpd-fan-driver.git#e49e1ffa59d738f928b81eb937647f1af420479c: Source: gpd-fan-driver-e49e1ffa.tar.gz BuildRequires: kmodtool %{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description Driver to control fans on various GPD devices %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 -T -b 0 -q -n gpd-fan-driver %patch 0 for kernel_version in %{?kernel_versions} ; do mkdir -p _kmod_build_${kernel_version%%___*} cp -a gpd-fan.c Makefile _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%%___*} VERSION=v%{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%%___*}/gpd-fan.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/gpd-fan.ko done %{?akmod_install} %changelog