%if 0%{?fedora} %global buildforkernels akmod %global debug_package %{nil} %endif Name: lg4ff %global full_name new-%{name} Version: 0.4.0 Release: 2%{?dist} Summary: Experimental Logitech force feedback module for Linux License: GPL-2.0-only URL: https://github.com/berarma/new-lg4ff Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: gcc BuildRequires: make BuildRequires: kmodtool BuildRequires: systemd-rpm-macros BuildRequires: sed Requires: bash Requires: lpf-xone-firmware Provides: %{name}-kmod-common = %{version}-%{release} Requires: %{name}-kmod >= %{version} # kmodtool does its magic here %{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description Improved Linux module driver for Logitech driving wheels. %package kmod Summary: Kernel module (kmod) for %{name} Requires: kernel-devel %description kmod kmod package for %{name} %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 %autosetup -c %{name}-%{version} -N pushd %{full_name}-%{version} %autopatch -m0 -p1 popd for kernel_version in %{?kernel_versions} ; do cp -a %{full_name}-%{version} _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%%___*} VERSION=v%{version} modules done %install for kernel_version in %{?kernel_versions}; do mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ install -D -m 755 _kmod_build_${kernel_version%%___*}/*.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/*.ko done %{?akmod_install} %files %doc %{full_name}-%{version}/README.md %license %{full_name}-%{version}/LICENSE %changelog * Sat Mar 23 2024 Jan200101 - 0.4.0-2 - fix mistake * Sat Mar 23 2024 Jan200101 - 0.4.0-1 - Initial spec