File python-gbinder.spec of Package python-gbinder

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


%{?sle15_python_module_pythons}
Name:           python-gbinder
Version:        1.1.2
Release:        0
Summary:        Python bindings for libgbinder
License:        GPL-3.0-or-later
URL:            https://github.com/erfanoabdi/gbinder-python
Source:         https://github.com/erfanoabdi/gbinder-python/archive/%{version}/%{name}-%{version}.tar.gz
BuildRequires:  %{pythons}
BuildRequires:  python-rpm-generators
BuildRequires:  %{python_module Cython}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  libgbinder-devel
BuildRequires:  libglibutil-devel
BuildRequires:  python-rpm-macros
%{?python_enable_dependency_generator}
%python_subpackages

%description
There are two Cython files: cgbinder.pxd describing the C++ API of the libgbinder library,
and gbinder.pyx describing classes that will be visible from Python user code. T
he .pyx imports .pxd to learn about C functions available to be called.

There is also setup.py file. This file describes how to build the extension module,
using distutils. In there, we specify the library to link with as libraries=['gbinder'].
The gbinder stands for libgbinder.so that we previously installed.

There are two options to build the package:

    One, use Cython's cythonize() function to generate a .c file from the .pyx one, and then compile it against the libgbinder.so library.
    Two, if the .c is already provided, just compile it - no Cython required!

%prep
%autosetup -n gbinder-python-%{version}

%build
%python_build build_ext --cython

%install
%python_install

%fdupes %{buildroot}%{_prefix}

%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitearch}/*

%changelog
openSUSE Build Service is sponsored by