File jstest-gtk.spec of Package jstest-gtk

#
# spec file for package jstest-gtk
#
# Copyright (c) 2013 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:           jstest-gtk
# Version is set/replaced by OBS by a timestamp when using git
Version:        0.1.1git.20180504
Release:        0
Summary:        Small tool to test and calibrate joysticks
License:        GPL-3.0
Group:          Hardware/Joystick
URL:            https://github.com/Grumbel/jstest-gtk/
Source:         %{name}-%{version}.tar.gz
BuildRequires:  libexpat-devel
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  gtkmm3-devel
BuildRequires:  expat
BuildRequires:  xorg-x11-libX11-devel
BuildRequires:  cmake
BuildRequires:  update-desktop-files
%if 0%{?suse_version} <= 1210
# Only needed for openSUSE <= 12.1; later it is pulled in by rpm-build.
BuildRequires: xz
%endif
Recommends:    input-utils


%description
Jstest-gtk is a simple joystick tester based on Gtk+. It provides you
with a list of attached joysticks, a way to display which buttons and
axis are pressed, a way to remap axis and buttons and a way to
calibrate your joystick.

Even when your joystick is working mostly fine, you might want to
give it a try, as the calibration lets you get rid of overlarge
default deadzones that many joysticks use and which are a noticeable
problem in some games.

Using appropriate apps in addition to this one will allow
you to store your calibration settings and mappings and have the
automatically restored.

%prep
%setup -q -n %{name}
# Specify full path for joystick icon
%__sed -i 's|"data/"|"%{_datadir}/%{name}/"|' src/main.cpp

%build
%cmake
make

%install
cd build
%__install -D -m 755 %{name} %{buildroot}%{_bindir}/%{name}
%__install -d %{buildroot}%{_datadir}/{%{name},pixmaps}
%__install -m 644 ../data/*.png %{buildroot}%{_datadir}/%{name}/
%__install -D -m 644 ../%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
%__ln_s -T %{_datadir}/%{name}/generic.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

%suse_update_desktop_file -i -G "Joystick testing and configuration tool" %{name} Settings HardwareSettings

%files
#define the files that actually get included in the rpm
%defattr(-,root,root)
%doc COPYING NEWS README.md TODO
%{_mandir}/man1/*
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by