File WattmanGTK.spec of Package WattmanGTK

#
# spec file for package WattmanGTK
#
# Copyright (c) 2020 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 http://bugs.opensuse.org/
#


Name:           WattmanGTK
Version:        
Release:        0
Summary:        A Wattman-like GTK3+ GUI
License:        GPL-2.0-only
Group:          System/X11/Utilities
URL:            https://github.com/BoukeHaarsma23/WattmanGTK
Source0:        %{name}-%{version}.tar.xz
Source1:        %{name}.desktop
Source2:        %{name}.png
BuildRequires:  ImageMagick
BuildRequires:  hicolor-icon-theme
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
Requires:       python3-cairo
Requires:       python3-gobject-Gdk
Requires:       python3-matplotlib-gtk3
Requires:       python3-matplotlib

%description
This is a Python3 program which uses a GTK gui to view, monitor a
Radeon GPU.

%prep
%autosetup
sed -i '/console_scripts/s/wattmanGTK/%{name}/' setup.py

%build
python3 setup.py build

%install
python3 setup.py install --prefix %{_prefix} --root %{buildroot}
install -Dm 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
for s in 16 22 32 48 64 96 128 192 256 512; do
    mkdir -pv %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps
    convert -resize ${s}x${s} %{SOURCE2} %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/%{name}.png
done

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{python3_sitelib}/*

%changelog
openSUSE Build Service is sponsored by