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 http://bugs.opensuse.org/
#

Name:           xboxdrv
Version:        0.8.5
Release:        0
License:        GPL-3.0+
Summary:        Xbox/Xbo360 USB Gamepad Driver for Userspace
Url:            http://pingus.seul.org/~grumbel/xboxdrv/
Group:          Hardware/Joystick
Source:         http://pingus.seul.org/~grumbel/xboxdrv/%{name}-linux-%{version}.tar.bz2
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

%description
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.

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

%build
make %{?_smp_mflags} 

%install
# 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}

%pre
%service_add_pre %{name}.service

%post
%service_add_post %{name}.service

%preun
%service_del_preun %{name}.service

%postun
%service_del_postun %{name}.service

%files
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS PROTOCOL README TODO VERSION
%{_bindir}/%{name}
%{_sbindir}/rc%{name}
%config(noreplace) %{_sysconfdir}/%{name}.conf
%dir %{_sysconfdir}/modprobe.d
%config %{_sysconfdir}/modprobe.d/50-xpad.conf
%{_unitdir}/%{name}.service
%{_mandir}/man1/%{name}.1.gz

%changelog
openSUSE Build Service is sponsored by