File input-remapper.spec of Package input-remapper
#
# spec file for package input-remapper
#
# Copyright (c) 2023 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/
#
%define pythons python3
%define module_name inputremapper
Name: input-remapper
Version: 2.0.1
Release: 0
Summary: An easy to use tool to change the behaviour of your input devices
License: GPL-3.0-or-later
URL: https://github.com/sezanzeb/input-remapper
Source: %{name}-%{version}.tar.xz
Patch1: input-remapper_locale_path.patch
Patch2: input-remapper_commit.patch
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module evdev }
BuildRequires: %{python_module devel }
BuildRequires: %{python_module pydantic }
BuildRequires: %{python_module pydbus }
BuildRequires: gtksourceview4-devel
Requires: python3-evdev
Requires: python3-pydantic
Requires: python3-pydbus
Requires: python3-setuptools
Requires: typelib-1_0-GtkSource-4
BuildArch: noarch
%description
An easy to use tool to change the behaviour of your input devices.
Supports X11, Wayland, combinations, programmable macros, joysticks, wheels,
triggers, keys, mouse-movements and more. Maps any input to any other input.
%lang_package
%prep
%setup -q
%patch -P 1 -p1
# generate commit_hash.py
%patch -P 2 -p1
commit="$(grep 'commit:' %{_sourcedir}/%{name}.obsinfo | cut -d' ' -f2)"
echo "COMMIT_HASH = '${commit}'" > %{module_name}/commit_hash.py
%build
%python_build
%install
%python_install
%find_lang %{name}
install -d %{buildroot}%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%fdupes %{buildroot}%{python_sitelib}/%{module_name}
%fdupes %{buildroot}%{_datadir}/locale
%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 readme/*
%config %{_sysconfdir}/dbus-1/system.d/%{module_name}.Control.conf
%config %{_sysconfdir}/xdg/autostart/%{name}-autoload.desktop
%{_bindir}/%{name}-control
%{_bindir}/%{name}-gtk
%{_bindir}/%{name}-reader-service
%{_bindir}/%{name}-service
%{python_sitelib}/input_remapper-*
%{python_sitelib}/%{module_name}/*
%dir %{python_sitelib}/%{module_name}
%{_unitdir}/%{name}.service
%{_sbindir}/rc%{name}
%{_datadir}/applications/%{name}-gtk.desktop
%{_datadir}/%{name}/*
%dir %{_datadir}/%{name}
%{_datadir}/polkit-1/actions/%{name}.policy
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/actions
%{_datadir}/metainfo/io.github.sezanzeb.input_remapper.metainfo.xml
%{_udevrulesdir}/99-%{name}.rules
%files lang -f %{name}.lang
%changelog