File g213colors-gui.spec of Package g213colors-gui

#
# spec file for package g213colors-gui
#
# Copyright (c) 2018 Julio Gonzalez Gil.
#
# 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.

%{!?_udevrulesdir: %global _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d }

Name:           g213colors-gui
Version:        0.5
Release:        0
Summary:        Change the key colors of Logitech G213 Prodigy Gaming Keyboards
License:        MIT
Group:          System/GUI/GNOME
Url:            https://github.com/derEisele/G213Colors
Source0:        https://github.com/derEisele/G213Colors/archive/v%{version}.tar.gz
Source1:        99-g213colors.rules
Patch0:         makefile-fixes.diff
Patch1:         manual-claiming.diff
Patch2:         mmkeys.diff
Patch3:         shebang.diff
Patch4:         gnomesu.diff
Patch5:         save-g203.diff
BuildRequires:  gtk3-tools
BuildRequires:  udev
Requires:       libgnomesu
Requires:       gtk3-tools
Requires:       python3-gobject
Requires:       python3-usb
Requires:       python3
Requires:       udev
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
A GUI Python script to change the key colors on a Logitech G213 Prodigy Gaming
Keyboard and G203 Prodigy Gaming Mouse

%prep
%setup -n G213Colors-%{version}
%autopatch -p1

%build

%install
install -D -m 0644 LICENSE %{buildroot}%{_docdir}/%{name}/LICENSE
install -D -m 0644 README.md %{buildroot}%{_docdir}/%{name}/README.md
install -D -m 0644 %{SOURCE1} %{buildroot}%{_udevrulesdir}/99-g213colors.rules
make install DESTDIR=%{buildroot} UNITDIR=%{_unitdir}
mkdir -p %{buildroot}%{_sbindir}
ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rcg213colors

%post
%{_bindir}/gtk-update-icon-cache -q /usr/share/icons/hicolor/
%service_add_post g213colors.service

%postun
%service_del_postun g213colors.service
%{_bindir}/gtk-update-icon-cache -q /usr/share/icons/hicolor/

%pre
%service_add_pre g213colors.service

%preun
%service_del_preun g213colors.service

%files
%defattr(-,root,root)
/usr/bin/G213Colors.py
/usr/bin/g213colors-gui
%{_sbindir}/rcg213colors
%config(noreplace) /etc/G213Colors-G203.conf
%config(noreplace) /etc/G213Colors-G213.conf
%{_udevrulesdir}/99-g213colors.rules
%{_unitdir}/g213colors.service
/usr/share/icons/hicolor/16x16/apps/g213colors.png
/usr/share/icons/hicolor/24x24/apps/g213colors.png
/usr/share/icons/hicolor/32x32/apps/g213colors.png
/usr/share/icons/hicolor/48x48/apps/g213colors.png
/usr/share/icons/hicolor/128x128/apps/g213colors.png
/usr/share/icons/hicolor/192x192/apps/g213colors.png
/usr/share/applications/g213colors.desktop
%doc LICENSE README.md

%changelog
openSUSE Build Service is sponsored by