Skip to content

Commit 436a967

Browse files
committed
Spec file improvements
- Use a macro for the %description section to avoid duplication. - Avoid duplicating the 'Summary' tag. - One BuildRequires per-line, use autosetup, remove 'Group' tags. - Explicitly include package and egg-info in %files.
1 parent efad81f commit 436a967

1 file changed

Lines changed: 33 additions & 46 deletions

File tree

packaging/python-evdev.spec

Lines changed: 33 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,52 @@
1-
%global gittag0 v0.6.1
2-
%global _summary Python bindings for the Linux input handling subsystem
3-
41
Name: python-evdev
52
Version: 0.6.1
63
Release: 1%{?dist}
7-
Summary: %{_summary}
4+
Summary: Python bindings for the Linux input handling subsystem
85

96
License: BSD
107
URL: https://python-evdev.readthedocs.io
11-
Source0: https://github.com/gvalkov/%{name}/archive/%{gittag0}.tar.gz#/%{name}-%{version}.tar.gz
12-
Group: Development/Libraries
8+
Source0: https://github.com/gvalkov/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
9+
10+
BuildRequires: kernel-headers
11+
BuildRequires: python-setuptools
12+
BuildRequires: python2-devel
13+
BuildRequires: python3-devel
14+
BuildRequires: python3-setuptools
15+
16+
17+
%global _description \
18+
This package provides python bindings to the generic input event interface in \
19+
Linux. The evdev interface serves the purpose of passing events generated in \
20+
the kernel directly to userspace through character devices that are typically \
21+
located in /dev/input/. \
22+
\
23+
This package also comes with bindings to uinput, the userspace input subsystem. \
24+
Uinput allows userspace programs to create and handle input devices that can \
25+
inject events directly into the input subsystem. \
26+
\
27+
In other words, python-evdev allows you to read and write input events on Linux. \
28+
An event can be a key or button press, a mouse movement or a tap on a \
29+
touchscreen.
1330

14-
BuildRequires: kernel-headers python3-devel python3-setuptools
15-
BuildRequires: python2-devel python-setuptools
1631

17-
%description
18-
This package provides bindings to the Linux generic input event interface.
32+
%description %{_description}
1933

2034

2135
%package -n python2-evdev
22-
Summary: %{_summary}
23-
Group: Development/Libraries
36+
Summary: %{summary}
2437
%{?python_provide:%python_provide python2-evdev}
25-
26-
%description -n python2-evdev
27-
28-
This package provides bindings to the generic input event interface in Linux.
29-
The evdev interface serves the purpose of passing events generated in the kernel
30-
directly to userspace through character devices that are typically located in
31-
/dev/input/.
32-
33-
This package also comes with bindings to uinput, the userspace input subsystem.
34-
Uinput allows userspace programs to create and handle input devices that can
35-
inject events directly into the input subsystem.
36-
37-
In other words, python-evdev allows you to read and write input events on Linux.
38-
An event can be a key or button press, a mouse movement or a tap on a
39-
touchscreen.
38+
%description -n python2-evdev %{_description}
4039

4140

4241
%package -n python3-evdev
43-
Summary: %{_summary}
44-
Group: Development/Libraries
42+
Summary: %{summary}
4543
%{?python_provide:%python_provide python3-evdev}
46-
47-
%description -n python3-evdev
48-
This package provides bindings to the generic input event interface in Linux.
49-
The evdev interface serves the purpose of passing events generated in the kernel
50-
directly to userspace through character devices that are typically located in
51-
/dev/input/.
52-
53-
This package also comes with bindings to uinput, the userspace input subsystem.
54-
Uinput allows userspace programs to create and handle input devices that can
55-
inject events directly into the input subsystem.
56-
57-
In other words, python-evdev allows you to read and write input events on Linux.
58-
An event can be a key or button press, a mouse movement or a tap on a
59-
touchscreen.
44+
%description -n python3-evdev %{_description}
6045

6146

6247
#------------------------------------------------------------------------------
6348
%prep
64-
%autosetup -n %{name}-%{version}
49+
%autosetup
6550

6651
#------------------------------------------------------------------------------
6752
%build
@@ -77,12 +62,14 @@ touchscreen.
7762
%files -n python2-evdev
7863
%license LICENSE
7964
%doc README.rst
80-
%{python2_sitearch}/*
65+
%{python2_sitearch}/evdev/
66+
%{python2_sitearch}/evdev-%{version}-py%{python2_version}.egg-info/
8167

8268
%files -n python3-evdev
8369
%license LICENSE
8470
%doc README.rst
85-
%{python3_sitearch}/*
71+
%{python3_sitearch}/evdev/
72+
%{python3_sitearch}/evdev-%{version}-py%{python3_version}.egg-info/
8673

8774

8875
#------------------------------------------------------------------------------

0 commit comments

Comments
 (0)