# buildforkernels macro hint: when you build a new version or a new release # that contains bugfixes or other improvements then you must disable the # "buildforkernels newest" macro for just that build; immediately after # queuing that build enable the macro again for subsequent builds; that way # a new akmod package will only get build when a new one is actually needed #define buildforkernels newest #define buildforkernels current %define buildforkernels akmod %define orig_name akvcam %define debug_package %{nil} Summary: Virtual camera driver for Linux Name: akvcam-kmod Version: 1.2.6 Release: 1%{?dist} License: GPLv2 Group: System Environment/Kernel URL: https://github.com/webcamoid/akvcam Source0: %{orig_name}-%{version}.tar.gz # get the needed BuildRequires (in parts depending on what we build for) BuildRequires: %{_bindir}/kmodtool %{!?kernels:BuildRequires: buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} } # kmodtool does its magic here %{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description akvcam is a fully compliant V4L2 virtual camera driver for Linux. This package provides kernel module for kernel %{kversion}. %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 %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null %setup -q -n %{orig_name}-%{version} for kernel_version in %{?kernel_versions} ; do cp -a src _kmod_build_${kernel_version%%___*} done %build for kernel_version in %{?kernel_versions}; do make %{?_smp_mflags} KDIR="${kernel_version##*___}" -C "${kernel_version##*___}" M="${PWD}/_kmod_build_${kernel_version%%___*}" modules done %install for kernel_version in %{?kernel_versions}; do install -D -m 0755 _kmod_build_${kernel_version%%___*}/akvcam.ko %{buildroot}/%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/akvcam.ko done %{?akmod_install} %changelog * Thu Apr 25 2024 Rok Mandeljc - 1.2.6-1 - Initial packaging attempt