File xnohands.spec of Package xnohands

#
# spec file for package xnohands
#
# Copyright (c) 2017 SUSE LINUX 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:           xnohands
Version:        0.1
Release:        0
Summary:        Disable XInput touch device when pen or eraser device reports proximity
License:        GPL-2.0+
Group:          System/X11/Utilities
Url:            https://math.berkeley.edu/~auroux/software/
Source0:        https://math.berkeley.edu/~auroux/software/%{name}.tar.gz
Source1:        https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
# PATCH-FIX-UPSTREAM xnohands-makefile-destdir-support.patch badshah400@gmail.com -- Add destdir support to make install
Patch0:         xnohands-makefile-destdir-support.patch
# PATCH-FIX-UPSTREAM xnohands-cflags.patch badshah400@gmail.com -- Add CFLAGS and LDFLAGS support to make
Patch1:         xnohands-cflags.patch
BuildRequires:  libX11-devel
BuildRequires:  libXi-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Disable XInput touch device when pen or eraser device reports proximity,
to avoid palm events when writing on a tablet PC with pen + touch.

XNoHands is designed for Tablet PCs running Linux and equipped
with both touch and pen devices.  The devices must be logically separate,
and the pen device must report proximity events.  (This is the case e.g.
with Wacom-based tablet PCs). XNoHands runs in the background of a user
session and disables the touchscreen device whenever the pen device is in
proximity of the screen. This allows the user to rest their hand on the
screen while writing without causing havoc.

%prep
%setup -q -n %{name}
%patch0 -p1
%patch1 -p1

%build
# There is only a Makefile, so adjust paths manually
sed -i "s|%{_prefix}/local/bin|%{_prefix}/bin|" Makefile
sed -i "s|%{_prefix}/local/bin|%{_prefix}/bin|" xnohands.desktop

export CFLAGS="%{optflags}"
make %{?_smp_mflags}

%install
mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_sysconfdir}/xdg/autostart
%make_install
cp %{SOURCE1} COPYING

%files
%defattr(-,root,root)
%doc README COPYING
%{_bindir}/xnohands
%{_sysconfdir}/xdg/autostart/*.desktop

%changelog
openSUSE Build Service is sponsored by