%global forgeurl https://github.com/atar-axis/xpadneo

Name: xpadneo
Version: 0.9.6
%forgemeta
Release: 1%{?dist}
Summary: Advanced linux driver for Xbox One Wireless Gamepad

# 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: GPL-2.0-only
URL: https://atar-axis.github.io/xpadneo
Source0: %{forgesource}

BuildArch: noarch

BuildRequires: systemd-rpm-macros

Requires: %{name}-kmod >= %{version}
Requires: bluez
Requires: bluez-tools

Provides: %{name}-kmod-common = %{version}-%{release}

%description
Advanced Linux Driver for Xbox One Wireless Controller (shipped with Xbox One
S).

  * Supports Bluetooth
  * Supports all Force Feedback/Rumble effects through Linux ff-memless effect
    emulation
  * Supports Trigger Force Feedback in every game by applying a
    pressure-dependent effect intensity to the current rumble effect (not even
    supported in Windows)
  * Supports disabling FF
  * Supports multiple Gamepads at the same time (not even supported in
    Windows)
  * Offers a consistent mapping, even if the Gamepad was paired to
    Windows/Xbox before, and independent of software layers (SDL2, Stadia via
    Chrome Gamepad API, etc)
  * Working Select, Start, Mode buttons
  * Correct Axis Range (signed, important for e.g. RPCS3)
  * Supports Battery Level Indication (including the Play 'n Charge Kit)
    Battery Level Indication
  * Easy Installation
  * Agile Support and Development
  * Supports customization through profiles (work in progress)
  * Optional high-precision mode for Wine/Proton users
  * Share button support on supported controllers
  * Works as a mouse if you're are in couch-mode (press Guide+Select)


%prep
%forgeautosetup


%install
install -D -p -m 0644 hid-%{name}/etc-modprobe.d/%{name}.conf %{buildroot}%{_modprobedir}/%{name}.conf
install -D -p -m 0644 hid-%{name}/etc-udev-rules.d/60-%{name}.rules %{buildroot}%{_udevrulesdir}/60-%{name}.rules


%files
%{_modprobedir}/%{name}.conf
%{_udevrulesdir}/60-%{name}.rules


%changelog
* Tue Feb 13 2024 Artem Polishchuk <ego.cordatus@gmail.com> - 0.9.6-1
- chore: Update to latest release

* Tue Mar 14 2023 Artem Polishchuk <ego.cordatus@gmail.com> - 0.9.5-2
- build: noarch package

* Sat Sep 17 2022 Artem Polishchuk <ego.cordatus@gmail.com> - 0.9.5-1
- chore(update): 0.9.5

* Thu May 26 2022 Artem Polishchuk <ego.cordatus@gmail.com> - 0.9.2-1
- chore(update): 0.9.2

* Tue Nov 02 2021 Artem Polishchuk <ego.cordatus@gmail.com> - 0.9.1-2
- build: Polish build to conform packaging guidelines

* Fri Jul 16 2021 Dorian Stoll <dorian.stoll@tmsp.io> - 0.9.1-1
- Initial package