File input-remapper.spec of Package input-remapper

#
# spec file for package input-remapper
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           input-remapper
Version:        1.4.2
Release:        0
Summary:        A tool to change the mapping of your input device buttons
License:        GPL-3.0-or-later
URL:            https://github.com/sezanzeb/input-remapper
Source0:        https://github.com/sezanzeb/input-remapper/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE input-remapper-locale_path.patch fix path for find-lang.sh -- aloisio@gmx.com
Patch0:         input-remapper-locale_path.patch
BuildRequires:  fdupes
BuildRequires:  python3-setuptools
Requires:       python3-evdev >= 1.3.0
Requires:       python3-pydantic
Requires:       python3-pydbus
Requires:       typelib-1_0-GtkSource-4
BuildArch:      noarch
%systemd_requires

%description
Input Remapper (formerly Key Mapper)

A tool to change the mapping of your input device buttons.
Supports mice, keyboards, gamepads, X11, Wayland, combined buttons and
programmable macros.
Allows mapping non-keyboard events (click, joystick, wheel) to keys of
keyboard devices.

%lang_package

%prep
%autosetup -p1
# remove shebang
find . -type f -name "*.py" -exec sed -i '1d' {} \;

%build
python3 setup.py build

%install
python3 setup.py install --root=%{buildroot} --prefix=%{_prefix}
%find_lang %{name}

%fdupes %{buildroot}%{_datadir}

%pre
%service_add_pre %{name}.service

%post
%service_add_post %{name}.service

%preun
%service_del_preun %{name}.service

%postun
%service_del_postun %{name}.service

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}-*
%{_bindir}/key-mapper-control
%{_bindir}/key-mapper-gtk
%{_bindir}/key-mapper-service
%{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/99-%{name}.rules
%{_datadir}/%{name}/%{name}*
%{_datadir}/%{name}/inputremapper.Control.conf
%{_datadir}/%{name}/style.css
%{_datadir}/polkit-1
%dir %{_sysconfdir}/dbus-1
%dir %{_sysconfdir}/dbus-1/system.d
%config %{_sysconfdir}/dbus-1/system.d/inputremapper.Control.conf
%config %{_sysconfdir}/xdg/autostart/%{name}-autoload.desktop
%{_udevrulesdir}/99-%{name}.rules
%{_unitdir}/%{name}.service
%{python3_sitelib}/inputremapper
%{python3_sitelib}/input_remapper-%{version}-py%{python3_version}.egg-info

%files lang -f %{name}.lang
%dir %{_datadir}/%{name}/locale
%dir %{_datadir}/%{name}/locale/*
%dir %{_datadir}/%{name}/locale/*/LC_MESSAGES

%changelog
openSUSE Build Service is sponsored by