File saltbundlepy-cairo.spec of Package saltbundlepy-cairo

#
# spec file for package saltbundlepy-cairo
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#

%{?!saltbundlepy_module:%define saltbundlepy_module() saltbundlepy-%{**}}
%define pythons saltbundlepy

# Disable python bytecompile for all distros
# It's called explicitly in the spec
%global __brp_python_bytecompile %{nil}

Name:           saltbundlepy-cairo
Version:        1.15.1
Release:        0
Summary:        Python Bindings for Cairo
# FIXME: on update, check if we still need to manually compile the byte-code in %%install
License:        LGPL-2.1-or-later OR MPL-1.1
Group:          Development/Libraries/Python
URL:            https://www.cairographics.org/pycairo
Source:         https://github.com/pygobject/pycairo/releases/download/v%{version}/pycairo-%{version}.tar.gz
BuildRequires:  %{saltbundlepy_module devel}
BuildRequires:  cairo-devel >= 1.12.0
BuildRequires:  saltbundlepy-rpm-macros
Provides:       saltbundlepy-pycairo = %{version}

%description
Python bindings for cairo.

%package devel
Summary:        Configuration files for %{python}-cairo
Group:          Development/Libraries/C and C++
Requires:       saltbundlepy-cairo = %{version}
Requires:       saltbundlepy-cairo-common-devel = %{version}
Requires:       saltbundlepy-devel

%description devel
Headers for saltbundlepy-cairo

%package -n %{name}-common-devel
Summary:        Headers for saltbundlepy-cairo
Group:          Development/Libraries/C and C++
Requires:       cairo-devel
Provides:       %{saltbundlepy_module cairo-common-devel = %{version}}

%description -n %{name}-common-devel
Headers for saltbundlepy-cairo

%python_subpackages

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

%build
%python_build

%install
%python_install
# pkgconfig files belong to %{_libdir}, not %{_prefix}/lib
%if "%{_lib}" == "lib64"
mkdir %{buildroot}%{_libdir}/pkgconfig
mv %{buildroot}%{_prefix}/lib/pkgconfig/*.pc %{buildroot}%{_libdir}/pkgconfig/
%endif

%files %{python_files}
%license COPYING
%doc COPYING-* NEWS
%{python_sitearch}/cairo/
%{python_sitearch}/pycairo-*.egg-info

%files %{python_files devel}
%{_libdir}/pkgconfig/py3cairo.pc

%files -n %{name}-common-devel
%{_includedir}/pycairo/

%changelog
openSUSE Build Service is sponsored by