From 94d665085d063a3c9bcf47856f5209ac85b1d3b1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 7 May 2019 02:19:09 -0400 Subject: [PATCH] import python-evdev-1.1.2-3.el8 --- .gitignore | 1 + .python-evdev.metadata | 1 + ...nput-fix-ioctl-return-value-handling.patch | 69 +++++++++ ...001-input-fix-unintended-fallthrough.patch | 25 ++++ SPECS/python-evdev.spec | 133 ++++++++++++++++++ 5 files changed, 229 insertions(+) create mode 100644 .gitignore create mode 100644 .python-evdev.metadata create mode 100644 SOURCES/0001-input-fix-ioctl-return-value-handling.patch create mode 100644 SOURCES/0001-input-fix-unintended-fallthrough.patch create mode 100644 SPECS/python-evdev.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..672993f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/python-evdev-1.1.2.tar.gz diff --git a/.python-evdev.metadata b/.python-evdev.metadata new file mode 100644 index 0000000..39c0ff4 --- /dev/null +++ b/.python-evdev.metadata @@ -0,0 +1 @@ +a4317e06e927d4eb85b0af81e05fdc37964b54a0 SOURCES/python-evdev-1.1.2.tar.gz diff --git a/SOURCES/0001-input-fix-ioctl-return-value-handling.patch b/SOURCES/0001-input-fix-ioctl-return-value-handling.patch new file mode 100644 index 0000000..d843d6f --- /dev/null +++ b/SOURCES/0001-input-fix-ioctl-return-value-handling.patch @@ -0,0 +1,69 @@ +From 061417d37f48ca6d77d6a5aacc4faa94be31cf62 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Fri, 5 Oct 2018 08:41:07 +1000 +Subject: [PATCH] input: fix ioctl return value handling() + +If any of those ioctls fail, the returned data is undefined. +--- + evdev/input.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/evdev/input.c b/evdev/input.c +index b37d3b7..67b9348 100644 +--- a/evdev/input.c ++++ b/evdev/input.c +@@ -250,7 +250,10 @@ ioctl_EVIOCGREP(PyObject *self, PyObject *args) + ret = PyArg_ParseTuple(args, "i", &fd); + if (!ret) return NULL; + +- ioctl(fd, EVIOCGREP, &rep); ++ ret = ioctl(fd, EVIOCGREP, &rep); ++ if (ret == -1) ++ return NULL; ++ + return Py_BuildValue("(ii)", rep[0], rep[1]); + } + +@@ -265,6 +268,9 @@ ioctl_EVIOCSREP(PyObject *self, PyObject *args) + if (!ret) return NULL; + + ret = ioctl(fd, EVIOCSREP, &rep); ++ if (ret == -1) ++ return NULL; ++ + return Py_BuildValue("i", ret); + } + +@@ -277,6 +283,9 @@ ioctl_EVIOCGVERSION(PyObject *self, PyObject *args) + if (!ret) return NULL; + + ret = ioctl(fd, EVIOCGVERSION, &res); ++ if (ret == -1) ++ return NULL; ++ + return Py_BuildValue("i", res); + } + +@@ -338,6 +347,9 @@ ioctl_EVIOCG_bits(PyObject *self, PyObject *args) + break; + } + ++ if (ret == -1) ++ return NULL; ++ + PyObject* res = PyList_New(0); + for (int i=0; i +Date: Fri, 5 Oct 2018 08:32:13 +1000 +Subject: [PATCH] input: fix unintended fallthrough + +--- + evdev/input.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/evdev/input.c b/evdev/input.c +index b3e6e08..b37d3b7 100644 +--- a/evdev/input.c ++++ b/evdev/input.c +@@ -381,7 +381,7 @@ void print_ff_effect(struct ff_effect* effect) { + effect->u.constant.envelope.attack_level, + effect->u.constant.envelope.fade_length, + effect->u.constant.envelope.fade_level); +- ++ break; + case FF_RUMBLE: + fprintf(stderr, " rumble: (%d, %d)\n", + effect->u.rumble.strong_magnitude, +-- +2.17.1 + diff --git a/SPECS/python-evdev.spec b/SPECS/python-evdev.spec new file mode 100644 index 0000000..9587486 --- /dev/null +++ b/SPECS/python-evdev.spec @@ -0,0 +1,133 @@ +%if 0%{?rhel} && 0%{?rhel} < 8 +%bcond_without legacy_python +%endif + +Name: python-evdev +Version: 1.1.2 +Release: 3%{?dist} +Summary: Python bindings for the Linux input handling subsystem + +License: BSD +URL: https://python-evdev.readthedocs.io +Source0: https://github.com/gvalkov/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz + +BuildRequires: gcc +BuildRequires: kernel-headers +%if %{with legacy_python} +BuildRequires: python2-devel +BuildRequires: python2-setuptools +%endif +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +Patch01: 0001-input-fix-ioctl-return-value-handling.patch +Patch02: 0001-input-fix-unintended-fallthrough.patch + +%global _description \ +This package provides python bindings to the generic input event interface in \ +Linux. The evdev interface serves the purpose of passing events generated in \ +the kernel directly to userspace through character devices that are typically \ +located in /dev/input/. \ + \ +This package also comes with bindings to uinput, the userspace input subsystem. \ +Uinput allows userspace programs to create and handle input devices that can \ +inject events directly into the input subsystem. \ + \ +In other words, python-evdev allows you to read and write input events on Linux. \ +An event can be a key or button press, a mouse movement or a tap on a \ +touchscreen. + + +%description %{_description} + + +%if %{with legacy_python} +%package -n python2-evdev +Summary: %{summary} +%{?python_provide:%python_provide python2-evdev} +%description -n python2-evdev %{_description} +%endif + +%package -n python3-evdev +Summary: %{summary} +%{?python_provide:%python_provide python3-evdev} +%description -n python3-evdev %{_description} + + +#------------------------------------------------------------------------------ +%prep +%autosetup -p1 + +#------------------------------------------------------------------------------ +%build +%if %{with legacy_python} +%py2_build +%endif +%py3_build + +#------------------------------------------------------------------------------ +%install +%if %{with legacy_python} +%py2_install +%endif +%py3_install + +#------------------------------------------------------------------------------ +%if %{with legacy_python} +%files -n python2-evdev +%license LICENSE +%doc README.rst +%{python2_sitearch}/evdev/ +%{python2_sitearch}/evdev-%{version}-py%{python2_version}.egg-info/ +%endif + +%files -n python3-evdev +%license LICENSE +%doc README.rst +%{python3_sitearch}/evdev/ +%{python3_sitearch}/evdev-%{version}-py%{python3_version}.egg-info/ + + +#------------------------------------------------------------------------------ +%changelog +* Fri Oct 05 2018 Peter Hutterer 1.1.2-3 +- Fix coverity complaints + +* Wed Sep 26 2018 Peter Hutterer 1.1.2-2 +- Don't build with python2 on RHEL8 + +* Wed Sep 26 2018 Peter Hutterer 1.1.2-1 +- Bump to version 1.1.2 + +* Tue Jul 31 2018 Florian Weimer - 1.0.0-2 +- Rebuild with fixed binutils + +* Sat Jul 28 2018 Georgi Valkov - 1.0.0-1 +- Bump to version 1.0.0 + +* Sat Jul 14 2018 Fedora Release Engineering - 0.7.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 0.7.0-3 +- Rebuilt for Python 3.7 + +* Fri Feb 09 2018 Fedora Release Engineering - 0.7.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Aug 22 2017 Georgi Valkov - 0.7.0-1 +- Bump to version 0.7.0 + +* Thu Aug 03 2017 Fedora Release Engineering - 0.6.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.6.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 0.6.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Dec 19 2016 Miro Hrončok - 0.6.1-2 +- Rebuild for Python 3.6 + +* Sun Jun 05 2016 Georgi Valkov - 0.6.1-1 +- Initial RPM Release