File python-efl.spec of Package python-efl

# spec file for package python-efl
# Copyright (c) 2016 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

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-efl
Version:        @SERVICE@
Release:        0
Summary:        Python bindings of evas
License:        GPL-3.0 and LGPL-3.0
Group:          Development/Libraries/Python
Source:         %{name}-%{version}.tar.xz
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(ecore)
BuildRequires:  pkgconfig(edje)
BuildRequires:  pkgconfig(elementary)
BuildRequires:  pkgconfig(emotion)
BuildRequires:  pkgconfig(eo)
BuildRequires:  pkgconfig(evas)
BuildRequires:  dbus-1-python-devel
BuildRequires:  dbus-1-python3-devel
BuildRequires:  python-cython >= 0.23.5
BuildRequires:  python3-Cython
BuildRequires:  %{python_module devel}
# cc1 uses too much memory on x86
#ExcludeArch:    %ix86
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  %{python_module rpm-macros}
# pre-unification mess
%if "%{python_flavor}" == "python2"
Obsoletes:      python-evas < %{version}
Provides:       python-evas = %{version}
Obsoletes:      python-ecore < %{version}
Provides:       python-ecore = %{version}
Obsoletes:      python-edje < %{version}
Provides:       python-edje = %{version}
Obsoletes:      python-emotion < %{version}
Provides:       python-emotion = %{version}
Obsoletes:      python-e_dbus < %{version}
Provides:       python-e_dbus = %{version}
Obsoletes:      python-elementary < %{version}
Provides:       python-elementary = %{version}

%if 0%{?suse_version}
%package -n python3-efl
Summary:        Python bindings of evas
Group:          Development/Python

%description -n python3-efl
Python bindings of the enlightenment foundation libraries (efl).

Python bindings of the enlightenment foundation libraries (efl).

%if 0%{?suse_version}
%package doc
Summary:        Documentation for python-efl
Group:          Documentation/HTML
BuildRequires:  %{python_module Sphinx}

%description doc
HTML formated documentation for python-efl module.

%package examples
Summary:        Examples of python-efl usage
Group:          Documentation/Other

%description examples
Some examples of usage of python-efl.

%setup -q
# drop build date from doc to fix build-compare
sed -i "s/\(html_last_updated_fmt = \).*/\\1None/" ./doc/

export CFLAGS="$CFLAGS -Wno-declaration-after-statement"
%ifarch %ix86
export CFLAGS="$CFLAGS -O0"
%if 0%{?suse_version}
%{python_expand $python build -g
$python build_doc}


# module itself

# documentation
%if 0%{?suse_version}
for _name in python-efl python3-efl; do
  install -m 0755 -d "%{buildroot}/%{_docdir}/$_name"
  cp -R build/sphinx/html "%{buildroot}/%{_docdir}/$_name"
  rm "%{buildroot}/%{_docdir}/$_name"/html/.buildinfo

%python_expand %fdupes %{buildroot}%{_docdir}
%python_expand %fdupes %{buildroot}%{$python_sitearch}

# examples
for _name in python-efl python3-efl; do
  install -m 0755 -d "%{buildroot}/%{_datadir}/$_name"
  cp -R examples/  "%{buildroot}/%{_datadir}/$_name/"
  mkdir -p %{buildroot}/%{_docdir}/$_name
  cp -pr COPYING %{buildroot}/%{_docdir}/$_name/
  cp -pr COPYING.LESSER %{buildroot}/%{_docdir}/$_name/
  cp -pr AUTHORS %{buildroot}/%{_docdir}/$_name/

%if 0%{?suse_version}
%files %{python_files}
%exclude %{_docdir}/%{name}/html/

%files %{python_files doc}

%files  %{python_files examples}

%if !0%{?suse_version}
%files -n python-efl

%files -n python3-efl

openSUSE Build Service is sponsored by