File xboxdrv.spec of Package xboxdrv

# spec file for package xboxdrv
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           xboxdrv
Version:        0.8.5
Release:        0
License:        GPL-3.0+
Summary:        Xbox/Xbo360 USB Gamepad Driver for Userspace
Group:          Hardware/Joystick
Source1:        50-xpad.conf
Source2:        %{name}.conf
Source3:        %{name}.service
BuildRequires:  scons
BuildRequires:  automake
BuildRequires:  dbus-1-glib-devel
BuildRequires:  libusb-1_0-devel
BuildRequires:  libudev-devel
BuildRequires:  libX11-devel
BuildRequires:  gcc-c++
BuildRequires:  boost-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Xboxdrv is a Xbox/Xbox360 gamepad driver for Linux that works in
userspace. It is an alternative to the xpad kernel driver and has
support for Xbox1 gamepads, Xbox360 USB gamepads and Xbox360 wireless
gamepads. The Xbox360 guitar and some Xbox1 dancemats might work too.
The Xbox 360 racing wheel is not supported, but shouldn't be to hard
to add if somebody is interested.

%setup -q -n %{name}-linux-%{version}

make %{?_smp_mflags} 

# don't use make install until python dependencies for xboxdrvctl 
# are clarified; also the man file is installed with incorrect permissions
mkdir -p %{buildroot}%{_bindir}
install -m 755 %{name} %{buildroot}%{_bindir}

mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/modprobe.d/
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}

mkdir -p %{buildroot}%{_mandir}/man1
install -m 644 doc/xboxdrv.1 %{buildroot}%{_mandir}/man1

mkdir -p %{buildroot}%{_unitdir}
install -m 644 %{SOURCE3} %{buildroot}%{_unitdir}

mkdir -p %{buildroot}%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}

%service_add_pre %{name}.service

%service_add_post %{name}.service

%service_del_preun %{name}.service

%service_del_postun %{name}.service

%config(noreplace) %{_sysconfdir}/%{name}.conf
%dir %{_sysconfdir}/modprobe.d
%config %{_sysconfdir}/modprobe.d/50-xpad.conf

openSUSE Build Service is sponsored by