File python3-pycairo.spec of Package python3-pycairo.29613

#
# spec file for package python-pycairo
#
# 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/
#


%define skip_python2 1
%define         oldpython python
Name:           python3-pycairo
Version:        1.20.1
Release:        0
Summary:        Python Bindings for Cairo
License:        LGPL-2.1-or-later OR MPL-1.1
URL:            https://github.com/pygobject/pycairo
Source:         https://github.com/pygobject/pycairo/releases/download/v%{version}/pycairo-%{version}.tar.gz
BuildRequires:  python3-devel
BuildRequires:  python3-pytest
BuildRequires:  python3-setuptools
BuildRequires:  cairo-devel >= 1.15.10
BuildRequires:  python-rpm-macros
Provides:       python3-cairo = %{version}
Obsoletes:      python3-cairo < %{version}

%description
Pycairo is a Python module providing bindings for the cairo graphics library.

%package        devel
Summary:        Development files for the Cairo Python bindings
Requires:       python3-devel
Requires:       python3-pycairo = %{version}
Requires:       python3-pycairo-common-devel = %{version}
Provides:       python3-cairo-devel = %{version}
Obsoletes:      python3-cairo-devel < %{version}

%description   devel
Pycairo is a Python module providing bindings for the cairo graphics library.

This package provides the development files needed to build
packages that depend on Pycairo.

%package     common-devel
Summary:        Headers for the Cairo Python bindings
Requires:       cairo-devel
Provides:       %{python_module cairo-common-devel = %{version}}
Provides:       %{python_module pycairo-common-devel = %{version}}
Obsoletes:      %{python_module cairo-common-devel < %{version}}
Provides:       %{python_module cairo-devel = %{version}}
Obsoletes:      %{python_module cairo-devel < %{version}}
Provides:       python3-cairo-common-devel = %{version}
Obsoletes:      python3-cairo-common-devel < %{version}

%description common-devel
Pycairo is a Python module providing bindings for the cairo graphics library.

This package provides the headers and development files needed to build
packages that depend on Pycairo.

%prep
%setup -q -n pycairo-%{version}

%build
# pyproject_* style of build doesn't work here
%python_build

%install
%python_install

# header files are not in the right place
mkdir -p %{buildroot}%{_includedir}
cp -r %{buildroot}%{python3_sitearch}/cairo/include %{buildroot}%{_includedir}/pycairo


%check
# this is not the deprecated setuptools test call but a custom setup compiling stuff and running pytest
%python_exec setup.py test

%files
%doc NEWS docs
%license COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
%{python3_sitearch}/cairo/
%exclude %{python_sitearch}/cairo/include
%{python3_sitearch}/pycairo-%{version}*-info

%files devel
%license COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
%{python3_sitearch}/cairo/include

%files common-devel
%license COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
%{_includedir}/pycairo/
%{_libdir}/pkgconfig/py3cairo.pc

%changelog
openSUSE Build Service is sponsored by