%global commit e96ef9a9e0a9261598137b3ad2c70fa018914764 %global shortcommit %(c=%{commit}; echo ${c:0:7}) #global gitdate 20221207 %define buildforkernels akmod %global debug_package %{nil} Name: rtl88x2bu-kmod Version: 5.13.2morrownr Release: 7%{?dist} Summary: Realtek %{kmod_name} linux wireless driver License: GPLv2 URL: https://github.com/farribeiro/rtl88x2bu Source0: %{URL}/archive/%{commit}/rtl88x2bu-%{shortcommit}.tar.gz %global AkmodsBuildRequires %{_bindir}/kmodtool xz time elfutils-libelf-devel gcc bc BuildRequires: %{AkmodsBuildRequires} # kmodtool does its magic here %{expand:%(kmodtool --target %{_target_cpu} --repo fedora --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description %{summary}. %package -n rtl88x2bu Summary: Common package of kernel modules for Realtek RTL88x2BU Driver Requires: %{name} = %{version}-%{release} Provides: %{name}-common = %{version}-%{release} %description -n rtl88x2bu %{summary}. %prep %{?kmodtool_check} #debug print what kmodtool generated kmodtool --target %{_target_cpu} --repo fedora --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null %setup -q -c -T -a 0 pushd rtl88x2bu-%{commit} popd echo "override rtl88x2bu * weak-updates/rtl88x2bu" > kmod-rtl88x2bu.conf for kernel_version in %{?kernel_versions} ; do cp -a rtl88x2bu-%{commit} _kmod_build_${kernel_version%%___*} done %build for kernel_version in %{?kernel_versions} ; do pushd _kmod_build_${kernel_version%%___*} make %{?_smp_mflags} \ KSRC=${kernel_version##*___} \ KVERS=${kernel_version%%___*} modules popd done %install %{__install} -d %{buildroot}%{_sysconfdir}/depmod.d/ %{__install} kmod-rtl88x2bu.conf %{buildroot}%{_sysconfdir}/depmod.d/ # Set the module(s) to be executable, so that they will be stripped when packaged. find %{buildroot} -type f -name \*.ko -exec %{__chmod} u+x \{\} \; for kernel_version in %{?kernel_versions}; do install -d %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix} install _kmod_build_${kernel_version%%___*}/*.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix} done %{?akmod_install} %files -n rtl88x2bu %license rtl88x2bu-%{commit}/LICENSE %doc rtl88x2bu-%{commit}/README.md %{_sysconfdir}/depmod.d/kmod-rtl88x2bu.conf