File python-atspi.spec of Package python-atspi

#
# spec file for package python-atspi
#
# Copyright (c) 2017 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 http://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-atspi
%define _name   pyatspi
Version:        2.26.0
Release:        0
Summary:        Assistive Technology Service Provider Interface - Python bindings
License:        LGPL-2.0
Group:          Development/Libraries/Python
Url:            http://www.gnome.org/
Source0:        http://download.gnome.org/sources/pyatspi/2.26/%{_name}-%{version}.tar.xz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module gobject >= 2.90.1}
BuildRequires:  %{python_module gobject-devel >= 2.90.1}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  python3-2to3
# Needed to have typelib() Requires.
BuildRequires:  gobject-introspection
Requires:       python-gobject >= 2.90.1
%ifpython2
Requires:       dbus-1-python
%endif
%ifpython3
Requires:       dbus-1-python3
%endif
# The bindings are really useful only if the at-spi registry is running. But
# it's not a strict runtime dependency.
Recommends:     at-spi2-core
# Virtual package, so that apps can depend on it, without having to know which
# at-spi stack is used. Only the default at-spi stack should define it.
%ifpython2
Provides:       py2atspi
Provides:       pyatspi
%endif
%ifpython3
Provides:       py3atspi
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
# Old versions of at-spi 1.x provided the same files
Conflicts:      at-spi < 1.29.3
%python_subpackages

%description
AT-SPI is a general interface for applications to make use of the
accessibility toolkit. This version is based on dbus.

This package contains the python bindings for AT-SPI.

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

%build
# Configure for out-of-tree builds
%define _configure ../configure

%{python_expand mkdir build_%{$python_bin_suffix}
pushd build_%{$python_bin_suffix}
export PYTHON=$python
%configure
make %{?_smp_mflags}
popd
}

%install
%{python_expand pushd build_%{$python_bin_suffix}
%make_install
popd
}

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

%files %{python_files}
%defattr(-,root,root)
%doc AUTHORS COPYING COPYING.GPL NEWS README
%{python_sitelib}/pyatspi/

%changelog
openSUSE Build Service is sponsored by