File python-gaphor.spec of Package python-gaphor
#
# spec file for package python-gaphor
#
# Copyright (c) 2021 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-gaphor
Version: 2.3.2
Release: 0
Summary: Gaphor is the simple modeling tool written in Python
License: Apache-2.0
URL: https://gaphor.org/
Source: https://files.pythonhosted.org/packages/source/g/gaphor/gaphor-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/gaphor/gaphor/master/logos/org.gaphor.Gaphor.svg
BuildRequires: python-rpm-macros
BuildRequires: update-desktop-files
BuildRequires: %{python_module setuptools}
# SECTION test requirements
BuildRequires: %{python_module gaphas >= 3.0.0b0}
BuildRequires: %{python_module generic >= 1.0.0}
BuildRequires: %{python_module importlib_metadata >= 1.4}
BuildRequires: %{python_module pycairo >= 1.18}
BuildRequires: %{python_module gobject >= 3.30}
BuildRequires: %{python_module tinycss2 >= 1.0.2}
BuildRequires: %{python_module typing_extensions >= 3.7.4}
BuildRequires: %{python_module pytest}
# /SECTION
BuildRequires: fdupes
Requires: python-gaphas >= 3.0.0b0
Requires: python-generic >= 1.0.0
Requires: python-importlib_metadata >= 1.4
Requires: python-pycairo >= 1.18
Requires: python-gobject >= 3.30
Requires: python-tinycss2 >= 1.0.2
Requires: python-typing_extensions >= 3.7.4
BuildArch: noarch
%python_subpackages
%description
Gaphor is the simple modeling tool written in Python.
%prep
%setup -q -n gaphor-%{version}
%build
%python_build
%install
%python_install
mkdir -p %{buildroot}/%{_datadir}/pixmaps/
%python_clone -a %{buildroot}%{_bindir}/gaphor
%python_clone -a %{buildroot}%{_bindir}/gaphorconvert
%{python_expand install -m 0644 %{SOURCE1} %{buildroot}/%{_datadir}/pixmaps/org.gaphor.Gaphor-%{$python_bin_suffix}.svg
}
%{python_expand #
%suse_update_desktop_file -c org.gaphor.Gaphor-%{$python_bin_suffix} Gaphor Gaphor gaphor org.gaphor.Gaphor "Office;ProjectManagement;"
}
%{python_expand #
%fdupes %{buildroot}%{$python_sitelib}
}
%post
%python_install_alternative gaphor gaphorconvert
%postun
%python_uninstall_alternative gaphor
%files %{python_files}
%doc README.md
%license LICENSE.txt
%python_alternative %{_bindir}/gaphor
%python_alternative %{_bindir}/gaphorconvert
%{_datadir}/applications/org.gaphor.Gaphor-%{python_bin_suffix}.desktop
%{_datadir}/pixmaps/org.gaphor.Gaphor-%{python_bin_suffix}.svg
%{python_sitelib}/*
%changelog