File DisplayCAL.spec of Package DisplayCAL

#
# spec file for package DisplayCAL (SUSE based distributions only)
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 Florian Hoech
#
# 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/
#

%{?primary_python:%define pythons %primary_python}
%{?sle15_python_module_pythons}
Summary:        Display calibration and profiling with a focus on accuracy and versatility
License:        GPL-3.0+
Group:          Productivity/Graphics/Other
Name:           DisplayCAL
Version:        3.9.16
Release:        0
Url:            https://github.com/eoyilmaz/displaycal-py3
Source0:        %{url}/archive/refs/tags/%{version}/displaycal-%{version}.tar.gz
Obsoletes:      DisplayCAL-0install < 3.8
Provides:       DisplayCAL-0install = %{version}
Obsoletes:      dispcalGUI < 3.1.0.0
Provides:       dispcalGUI = %{version}
Obsoletes:      dispcalGUI-0install < 3.1.0.0
Provides:       dispcalGUI-0install = %{version}
BuildRequires:  %{python_module devel => 3.8}
BuildRequires:  %{python_module xml}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module wheel}
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  gcc
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(udev)
BuildRequires:  pkgconfig(xxf86vm)
BuildRequires:  update-desktop-files
Requires:       argyllcms
Requires:       %{python_flavor}-Pillow
Requires:       %{python_flavor}-PyChromecast
Requires:       %{python_flavor}-Send2Trash
Requires:       %{python_flavor}-certifi
Requires:       %{python_flavor}-distro
Requires:       %{python_flavor}-dbus-python
Requires:       %{python_flavor}-gobject
Requires:       %{python_flavor}-numpy
Requires:       %{python_flavor}-psutil
Requires:       %{python_flavor}-pyglet
Requires:       %{python_flavor}-wxPython >= 4.2.0
Requires:       %{python_flavor}-wxWidgets
Requires:       %{python_flavor}-xml
Requires:       %{python_flavor}-zeroconf
BuildArch:      noarch
%python_subpackages

%description
This utility calibrates and characterizes display devices using one
of many supported measurement instruments, with support for
multi-display setups and a variety of available options for advanced
users, such as verification and reporting functionality to evaluate
ICC profiles and display devices, creating video 3D LUTs, as well as
optional CIECAM02 gamut mapping to take into account varying viewing
conditions.

%prep
%autosetup -p1 -n displaycal-%{version}
dos2unix LICENSE.txt
sed -i 's|license = "GPL-3.0-or-later"|license = {text = "GPL-3.0-or-later"}|' pyproject.toml

%build
%pyproject_wheel

%install
%pyproject_install

# Remove doc dir (we will take care of it in files)
rm -r %{buildroot}%{_datadir}/doc/%{name}-%{version}

# Move autostart to correct location
install -d -m 0755 %{buildroot}/etc/xdg/autostart
cp -av %{buildroot}%{python_sitelib}/home/abuild/.config/autostart %{buildroot}/etc/xdg
rm -rf %{buildroot}%{python_sitelib}/home/abuild/.config

# Remove unneeded executable
%python_expand rm -f %{buildroot}%{python_sitelib}/DisplayCAL/__main__.py

%python_expand %fdupes %{buildroot}%{python_sitelib}

%files 
%license LICENSE.txt
%doc README.html README-fr.html screenshots theme
%config %{_sysconfdir}/xdg/autostart/z-displaycal-apply-profiles.desktop
%{_mandir}/man1/displaycal-3dlut-maker.1.gz
%{_mandir}/man1/displaycal-apply-profiles.1.gz
%{_mandir}/man1/displaycal-curve-viewer.1.gz
%{_mandir}/man1/displaycal-profile-info.1.gz
%{_mandir}/man1/displaycal-scripting-client.1.gz
%{_mandir}/man1/displaycal-synthprofile.1.gz
%{_mandir}/man1/displaycal-testchart-editor.1.gz
%{_mandir}/man1/displaycal-vrml-to-x3d-converter.1.gz
%{_mandir}/man1/displaycal.1.gz
%exclude %{python_sitelib}/misc
%exclude %{python_sitelib}/util
%exclude %{python_sitelib}/tests
%exclude %{_datadir}/doc-base
%exclude %{_datadir}/doc/packages/%{name}/theme/*.png
%{python_sitelib}/%{name}/
%{python_sitelib}/displaycal-%{version}.dist-info
%{_bindir}/*
%{_datadir}/%{name}/
%{_datadir}/applications/
%{_datadir}/icons/hicolor
%{_datadir}/metainfo/

%changelog
openSUSE Build Service is sponsored by