%if 0%{?fedora} %global buildforkernels akmod %global debug_package %{nil} %endif # name should have a -kmod suffix Name: hori-truck-control-system-kmod Version: 0.0.2 Release: 1%{?dist}.1 Summary: Driver for the Hori Truck Control System Group: System Environment/Kernel License: GPL-2.0-only URL: https://github.com/LinuxGamesTV/hori_control_systems Source0: https://github.com/LinuxGamesTV/hori_control_systems/archive/refs/tags/%{version}.tar.gz BuildRequires: kmodtool # Verify that the package build for all architectures. # In most time you should remove the Exclusive/ExcludeArch directives # and fix the code (if needed). # ExclusiveArch: i686 x86_64 ppc64 ppc64le armv7hl aarch64 # ExcludeArch: i686 x86_64 ppc64 ppc64le armv7hl aarch64 # kmodtool does its magic here %{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description Kernel module for the HORI Control Systems HID driver (hid-hori). Supports HORI steering wheels including all three pedals (gas, brake, clutch), the shifter, hat switch, and analog stick mouse emulation. Requires kernel 6.12 or higher. This driver is early alpha — use at your own risk. %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 # apply patches and do other stuff here # pushd foo-%{version} # #patch0 -p1 -b .suffix # popd for kernel_version in %{?kernel_versions} ; do cp -a foo-%{version} _kmod_build_${kernel_version%%___*} done %build for kernel_version in %{?kernel_versions}; do make %{?_smp_mflags} -C "${kernel_version##*___}" SUBDIRS=${PWD}/_kmod_build_${kernel_version%%___*} modules done %install rm -rf ${RPM_BUILD_ROOT} for kernel_version in %{?kernel_versions}; do make install DESTDIR=${RPM_BUILD_ROOT} KMODPATH=%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix} # install -D -m 755 _kmod_build_${kernel_version%%___*}/foo/foo.ko ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/foo.ko done %{?akmod_install} %clean rm -rf $RPM_BUILD_ROOT