%define buildforkernels akmod %global debug_package %{nil} Name: ddcci-driver-linux-kmod Version: 0.4.4 Release: 3%{?dist} Summary: A pair of Linux kernel drivers for DDC/CI monitors Group: System Environment/Kernel License: GPL2 URL: https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/ Source0: https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/-/archive/v%{version}/ddcci-driver-linux-v%{version}.tar.gz Source1: ddcci-drv.service Source2: ddcci-modprobe.sh BuildRequires: systemd-rpm-macros BuildRequires: %{_bindir}/kmodtool Requires: %{name}-common Patch0: 0001-Support-kernel-v6.6.patch Patch1: 0001-Compatibility-with-Linux-6.8.patch # kmodtool does its magic here %{expand:%(kmodtool --target %{_target_cpu} --repo %{repo} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description %{summary}. %package common Summary: Userland package for ddcci-driver-linux Group: System Environment/Kernel Provides: %{name}-common = %{version}-%{release} %description common Userland package for ddcci-driver-linux %prep # error out if there was something wrong with kmodtool %{?kmodtool_check} # print kmodtool output for debugging purposes: kmodtool --target %{_target_cpu} --repo %{repo} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null %setup -q -c -T -a 0 pushd ddcci-driver-linux-v%{version} %patch0 -p1 %patch1 -p1 popd for kernel_version in %{?kernel_versions} ; do cp -a ddcci-driver-linux-v%{version} _kmod_build_${kernel_version%%___*} done cp -rf %{_topdir}/SOURCES/ddcci-drv.service . cp -rf %{_topdir}/SOURCES/ddcci-modprobe.sh . %build for kernel_version in %{?kernel_versions}; do make %{?_smp_mflags} -C "${kernel_version##*___}" M="${PWD}/_kmod_build_${kernel_version%%___*}/ddcci" modules make %{?_smp_mflags} -C "${kernel_version##*___}" M="${PWD}/_kmod_build_${kernel_version%%___*}/ddcci-backlight" modules done %install install -D ddcci-drv.service ${RPM_BUILD_ROOT}%{_unitdir}/ddcci-drv.service install -D -m 755 ddcci-modprobe.sh ${RPM_BUILD_ROOT}%{_exec_prefix}/lib/ddcci-driver/ddcci-modprobe.sh for kernel_version in %{?kernel_versions}; do install -d ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix} install -D -m 0755 _kmod_build_${kernel_version%%___*}/*/*.ko ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix} done %{?akmod_install} %files common %{_unitdir}/ddcci-drv.service %{_exec_prefix}/lib/ddcci-driver/ddcci-modprobe.sh %changelog * Sat May 18 2024 Alberto Pedron - 0.4.4-3 - Add support for 6.8 kernel * Sun Feb 25 2024 Alberto Pedron - 0.4.4-2 - Add support for 6.6 kernel * Sun Aug 20 2023 Alberto Pedron - 0.4.4-1 - Update to v0.4.4 * Sat Jun 17 2023 Alberto Pedron - 0.4.3-3 - Add support for 6.4 kernel * Sun Jun 04 2023 Alberto Pedron - 0.4.3-2 - Fix build on 6.3 kernel * Mon Apr 24 2023 Alberto Pedron - 0.4.3-1 - Initial release