%global buildforkernels akmod %global debug_package %{nil} # Enable zipping the modules with xz %global zipmodules 1 %define __spec_install_post \ %{__arch_install_post}\ %{__os_install_post}\ %{__mod_compress_install_post} %define __mod_compress_install_post \ if [ "%{zipmodules}" -eq "1" ]; then \ find %{buildroot}/usr/lib/modules/ -type f -name '*.ko' | xargs xz; \ fi Name: i915-sriov-kmod Version: 0.0.git.92.8f224c90 Release: 1%{?dist} Summary: Linux i915 module patched with SR-IOV support. License: GPLv2 URL: https://github.com/strongtz/i915-sriov-dkms Source: %{url}/archive/refs/heads/master.tar.gz BuildRequires: kmodtool ExclusiveArch: x86_64 %{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description Linux i915 module patched with SR-IOV support. %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 i915-sriov-dkms-master echo "search extra" > kmod-i915-sriov.conf echo "override i915 * extra/i915-sriov/" >> kmod-i915-sriov.conf find . -type f -name '*.c' -exec sed -i "s/#VERSION#/%{version}/" {} \+ for kernel_version in %{?kernel_versions} ; do cp -a i915-sriov-dkms-master _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%%___*} KVER=${kernel_version%%___*} done %install for kernel_version in %{?kernel_versions}; do mkdir -p %{buildroot}/%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ install -p -m 0755 _kmod_build_${kernel_version%%___*}/*.ko \ %{buildroot}/%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ done %{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/ %{__install} kmod-i915-sriov.conf %{buildroot}%{_sysconfdir}/depmod.d/ %{?akmod_install} %clean rm -rf %{buildroot} %files /%{_sysconfdir}/depmod.d/kmod-i915-sriov.conf %changelog