%global buildforkernels akmod %global debug_package %{nil} %global forgeurl https://github.com/atar-axis/xpadneo Name: xpadneo-kmod Version: 0.9.1 Release: 1%{?dist} Summary: Advanced linux driver for Xbox One Wireless Gamepad %forgemeta # The license in the repository says GPLv3 but it was autogenerated by Github. # The module declares its license as GPL, which in a kernel module means GPLv2. License: GPLv2 URL: %{forgeurl} Source0: %{forgesource} BuildRequires: kmodtool %{expand: %(kmodtool --target %{_target_cpu} \ --kmodname %{name} \ %{?buildforkernels:--%{buildforkernels}} \ %{?kernels:--for-kernels "%{?kernels}"} 2> /dev/null \ )} %description Advanced Linux Driver for Xbox One Wireless Controller (shipped with Xbox One S) # Macros to simplify some of the bash magic thats used below # Can only be used if a bash variable $kernel_version is in scope %global _kernel_version ${kernel_version%%___*} %global _kernel_srcdir ${kernel_version##*___} %global _kmod_builddir _kmod_build_%{_kernel_version} %global _kmod_instdir %{buildroot}%{kmodinstdir_prefix}%{_kernel_version}%{kmodinstdir_postfix} %prep %forgeautosetup %{?kmodtool_check} for kernel_version in %{?kernel_versions}; do cp -fr hid-xpadneo %{_kmod_builddir} done echo %{version} > VERSION %build for kernel_version in %{?kernel_versions}; do pushd %{_kmod_builddir} %make_build KERNEL_SOURCE_DIR=%{_kernel_srcdir} modules popd done %install for kernel_version in %{?kernel_versions}; do mkdir -p %{_kmod_instdir} install -pm 0755 %{_kmod_builddir}/src/*.ko %{_kmod_instdir} done %{?akmod_install} %changelog * Fri Jul 16 2021 Dorian Stoll - 0.9.1-1 - Initial package