File kde-material-you-colors.spec of Package kde-material-you-colors

#
# spec file for package kde-material-you-colors
#
# Copyright (c) 2025 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/
#

%global kf6_version 6.0.0
%define pythons python3
%if 0%{?fedora}
%global debug_package %{nil}
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%endif

Name:           kde-material-you-colors
Version:        2.1.0
Release:        0%{?dist}
Summary:        Automatic Material You Colors from your wallpaper for the Plasma Desktop
License:        GPL-3.0-only
URL:            https://github.com/luisbocanegra/%{name}
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires:  gcc
BuildRequires:  cmake >= 3.16
BuildRequires:  extra-cmake-modules >= %{kf6_version}
BuildRequires:  cmake(KF6CoreAddons)
BuildRequires:  cmake(KF6Service)
BuildRequires:  cmake(Plasma)
BuildRequires:  cmake(Plasma5Support)
BuildRequires:  pkgconfig(ocl-icd)
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  pkgconfig(python3)
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools >= 61.0}
BuildRequires:  %{python_module wheel >= 0.37.1}
%if 0%{?fedora}
BuildRequires:  generic-logos
BuildRequires:  %{python_module dbus}
Requires:       %{py3_dist dbus-python}
%else
BuildRequires:  %{python_module dbus-python}
Requires:       %{python_module dbus-python}
%endif
Requires:       %{py3_dist file-magic}
Requires:       %{py3_dist numpy}
Requires:       %{py3_dist materialyoucolor}
Requires:       %{py3_dist pywal16}
Requires:       %{py3_dist pillow}

%description
Automatic Material You Colors Generator from your wallpaper for the Plasma Desktop

%prep
%autosetup -p1 -n %{name}-%{version}
sed -iE 's:\"python-magic.*\":\"file-magic\":' pyproject.toml

%build
%pyproject_wheel
%cmake -DINSTALL_PLASMOID=ON -S %{_builddir}/%{name}-%{version}
%cmake_build

%install
%pyproject_install
%cmake_install

sed -Ei "s:^(#!.*)env (python.*)$:\1python3:" %{buildroot}%{python3_sitelib}/kde_material_you_colors/main.py
chmod +x %{buildroot}%{python3_sitelib}/kde_material_you_colors/main.py
chmod -x %{buildroot}%{_datadir}/applications/kde-material-you-colors-screenshot-helper.desktop
%fdupes %{buildroot}%{python3_sitelib}/

%files
%doc README.md
%license LICENSE
%{_bindir}/kde-material-you-colors
%{python3_sitelib}/kde_material_you_colors/
%{python3_sitelib}/kde_material_you_colors-%{version}*.*-info/
%{_bindir}/%{name}-screenshot-helper
%{_datadir}/applications/*
%{_datadir}/plasma/plasmoids/*

%if (0%{?fedora} && 0%{?fedora} < 43) || (0%{?suse_version} && 0%{?suse_version} < 1699)
%{_datadir}/metainfo/*
%endif

%changelog
openSUSE Build Service is sponsored by