Split some of the tools into a libinput-utils package so we can require

the various bits easier (#1509298)
This commit is contained in:
Peter Hutterer 2017-11-09 15:00:48 +10:00
parent 16249394c5
commit 9a7d455eba
2 changed files with 73 additions and 11 deletions

View File

@ -0,0 +1,46 @@
From 92aa1d14183bd88a8080be96672682a2e5696477 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 9 Nov 2017 15:17:37 +1000
Subject: [PATCH libinput] tools: when the command isn't installed, print that
Makes it more user-friendly to be able to split the tools into multiple
packages
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
tools/shared.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/tools/shared.c b/tools/shared.c
index ae3287ba..962159e1 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -510,11 +510,20 @@ tools_exec_command(const char *prefix, int real_argc, char **real_argv)
setup_path();
rc = execvp(executable, argv);
- if (rc)
- fprintf(stderr,
- "Failed to execute '%s' (%s)\n",
- command,
- strerror(errno));
+ if (rc) {
+ if (errno == ENOENT) {
+ fprintf(stderr,
+ "libinput: %s is not a libinput command or not installed. "
+ "See 'libinput --help'\n",
+ command);
+
+ } else {
+ fprintf(stderr,
+ "Failed to execute '%s' (%s)\n",
+ command,
+ strerror(errno));
+ }
+ }
return EXIT_FAILURE;
}
--
2.13.6

View File

@ -5,7 +5,7 @@
Name: libinput
Version: 1.9.1
Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Summary: Input device library
License: MIT
@ -18,6 +18,8 @@ Source2: commitid
Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}.tar.xz
%endif
Patch01: 0001-tools-when-the-command-isn-t-installed-print-that.patch
BuildRequires: git-core
BuildRequires: gcc
BuildRequires: meson
@ -43,6 +45,14 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package utils
Summary: Utilities and tools for debugging %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python3-evdev python3-pyudev
%description utils
The %{name}-utils package contains tools to debug hardware and analyze
%{name}.
%prep
%setup -q -n %{name}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}}
@ -86,17 +96,8 @@ git am -p1 %{patches} < /dev/null
%dir %{_libexecdir}/libinput/
%{_libexecdir}/libinput/libinput-debug-events
%{_libexecdir}/libinput/libinput-list-devices
%{_libexecdir}/libinput/libinput-measure
%{_libexecdir}/libinput/libinput-measure-touchpad-tap
%{_libexecdir}/libinput/libinput-measure-touch-size
%{_libexecdir}/libinput/libinput-measure-touchpad-pressure
%{_libexecdir}/libinput/libinput-measure-trackpoint-range
%{_mandir}/man1/libinput.1*
%{_mandir}/man1/libinput-measure.1*
%{_mandir}/man1/libinput-measure-touchpad-tap.1*
%{_mandir}/man1/libinput-measure-touch-size.1*
%{_mandir}/man1/libinput-measure-touchpad-pressure.1*
%{_mandir}/man1/libinput-measure-trackpoint-range.1*
%{_mandir}/man1/libinput-list-devices.1*
%{_mandir}/man1/libinput-debug-events.1*
%{_bindir}/libinput-list-devices
@ -107,8 +108,23 @@ git am -p1 %{patches} < /dev/null
%{_libdir}/libinput.so
%{_libdir}/pkgconfig/libinput.pc
%files utils
%{_libexecdir}/libinput/libinput-measure
%{_libexecdir}/libinput/libinput-measure-touchpad-tap
%{_libexecdir}/libinput/libinput-measure-touchpad-pressure
%{_libexecdir}/libinput/libinput-measure-touch-size
%{_libexecdir}/libinput/libinput-measure-trackpoint-range
%{_mandir}/man1/libinput-measure.1*
%{_mandir}/man1/libinput-measure-touchpad-tap.1*
%{_mandir}/man1/libinput-measure-touch-size.1*
%{_mandir}/man1/libinput-measure-touchpad-pressure.1*
%{_mandir}/man1/libinput-measure-trackpoint-range.1*
%changelog
* Thu Nov 09 2017 Peter Hutterer <peter.hutterer@redhat.com> 1.9.1-2
- Split some of the tools into a libinput-utils package so we can require
the various bits easier (#1509298)
* Mon Oct 30 2017 Peter Hutterer <peter.hutterer@redhat.com> 1.9.1-1
- libinput 1.9.1