%global up_name input-remapper %global common_description %{expand: An easy to use 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.} Name: python-%{up_name} Version: 2.0.0 Release: 1%{?dist} Summary: An easy to use tool to change the mapping of your input device buttons License: GPL-3.0-or-later URL: https://github.com/sezanzeb Source0: %{url}/%{up_name}/archive/master/%{up_name}-%{version}.tar.gz Source1: 99-%{up_name}.preset BuildArch: noarch %description %{common_description} %package -n python3-%{up_name} Summary: %{summary} BuildRequires: desktop-file-utils BuildRequires: libappstream-glib BuildRequires: pyproject-rpm-macros BuildRequires: systemd-rpm-macros BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-wheel BuildRequires: gettext BuildRequires: git Requires: python3-pydbus Requires: python3-gobject Requires: python3-evdev >= 1.3.0 Requires: gtksourceview4 Requires: python3-pydantic %generate_buildrequires %pyproject_buildrequires -r %description -n python3-%{up_name} %{common_description} %prep %autosetup -p1 -n %{up_name}-main #Fix rpmlint errors #find inputremapper/ -iname "*.py" -type f -print0 | xargs -0 sed -i -e 's+\s*#\s*!/usr/bin/python3++' %build %pyproject_wheel %install %pyproject_install %pyproject_save_files inputremapper %__mv %{buildroot}%{python3_sitelib}/etc %{buildroot}/etc %__mv %{buildroot}%{python3_sitelib}/usr/bin %{buildroot}/usr/bin %__mv %{buildroot}%{python3_sitelib}/usr/lib/systemd %{buildroot}/usr/lib/systemd %__mv %{buildroot}%{python3_sitelib}/usr/lib/udev %{buildroot}/usr/lib/udev %__mv %{buildroot}%{python3_sitelib}/usr/share %{buildroot}/usr/share %__install -Dm0644 %{SOURCE1} -t %{buildroot}%{_presetdir} %post -n python3-%{up_name} %systemd_post input-remapper.service if [ $1 -eq 1 ] && [ -x /usr/bin/systemctl ]; then /usr//bin/systemctl start input-remapper.service > /dev/null 2>&1 || : fi %preun -n python3-%{up_name} %systemd_preun %{up_name}.service %postun -n python3-%{up_name} %systemd_postun %{up_name}.service %check desktop-file-validate %{buildroot}/%{_datadir}/applications/%{up_name}-gtk.desktop appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml %files -n python3-%{up_name} -f %{pyproject_files} %doc README.md %license LICENSE %{_sysconfdir}/dbus-1/system.d/inputremapper.Control.conf %{_sysconfdir}/xdg/autostart/%{up_name}-autoload.desktop %{_bindir}/%{up_name}* %{_bindir}/%{up_name}* %{python3_sitelib}/input_remapper-%{version}.dist-info/ %{python3_sitelib}/inputremapper/ %{_unitdir}/%{up_name}.service %{_presetdir}/99-%{up_name}.preset %{_udevrulesdir}/99-%{up_name}.rules %{_datadir}/%{up_name} %{_datadir}/applications/%{up_name}-gtk.desktop %{_datadir}/polkit-1/actions/%{up_name}.policy %{_metainfodir}/*.metainfo.xml %changelog * Mon Mar 20 2023 Alexander Ploumistos - 2.0.0-1 - Update to 2.0.0 * Thu Nov 17 2022 Alexander Ploumistos - 1.5.0-2 - Rework files stanza * Wed Nov 16 2022 Alexander Ploumistos - 1.5.0-1 - Version 1.5.0 - Spec file based on Paweł Marciniak's work - Fix license