1
0

Accepting request 516044 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/516044
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-matplotlib?expand=0&rev=54
This commit is contained in:
2017-08-13 12:58:58 +00:00
committed by Git OBS Bridge
parent 946bb729f5
commit 287ecc9cb6
5 changed files with 98 additions and 42 deletions

View File

@@ -19,10 +19,25 @@
#Not doing tests because they take too long
%bcond_with tests
# backend dependencies missing on Leap 42.2 i596 and all versions of SLE
%if 0%{?is_opensuse}
%ifarch %{ix86}
%if 0%{?leap_version} == 420200
%bcond_with backends
%else
%bcond_without backends
%endif
%else
%bcond_without backends
%endif
%else
%bcond_with backends
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name: python-matplotlib
Version: 2.0.0
Version: 2.0.2
Release: 0
Summary: Plotting Library for Python
License: SUSE-Matplotlib
@@ -33,24 +48,24 @@ Source1: matplotlib-setup.cfg
# PATCH-FIX-OPENSUSE 0001-Fix-include-path-for-system-libqhull.patch stefan.bruens@rwth-aachen.de -- avoid using bundled qhull, fixed in mpl 2.1.0
Patch0: 0001-Fix-include-path-for-system-libqhull.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-rpm-macros
BuildRequires: c++_compiler
BuildRequires: fdupes
BuildRequires: fltk-devel
BuildRequires: ghostscript
BuildRequires: libxml2-tools
BuildRequires: poppler-tools
BuildRequires: qhull-devel >= 2003.1
BuildRequires: pkg-config
BuildRequires: poppler-tools
BuildRequires: python-rpm-macros
BuildRequires: qhull-devel >= 2003.1
BuildRequires: pkgconfig(freetype2) >= 2.3
BuildRequires: pkgconfig(libpng) >= 1.2
# Python 2 only
BuildRequires: python-functools32
BuildRequires: python-subprocess32
# Needed for all versions of python
BuildRequires: %{python_module devel}
BuildRequires: %{python_module Cycler}
BuildRequires: %{python_module Pillow}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy >= 1.6}
BuildRequires: %{python_module numpy-devel >= 1.6}
BuildRequires: %{python_module pyparsing >= 1.5.6}
@@ -60,27 +75,30 @@ BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six >= 1.3}
# needed for testing
%if %{with tests}
BuildRequires: inkscape
BuildRequires: %{python_module mock}
BuildRequires: %{python_module nose}
BuildRequires: inkscape
%endif
# cairo dependencies
BuildRequires: %{python_module cairocffi}
# GTK3 dependencies
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: %{python_module gobject}
BuildRequires: %{python_module gobject-devel}
# latex dependencies
BuildRequires: texlive-dvipng
BuildRequires: texlive-latex
BuildRequires: texlive-tex
%if 0%{?is_opensuse}
BuildRequires: texlive-sfmath
%endif
%if %{with backends}
# cairo dependencies
BuildRequires: %{python_module cairocffi}
# GTK3 dependencies
BuildRequires: %{python_module gobject-devel}
BuildRequires: %{python_module gobject}
BuildRequires: pkgconfig(gtk+-3.0)
# Qt4 dependencies
BuildRequires: %{python_module qt4}
BuildRequires: %{python_module qt4-devel}
BuildRequires: %{python_module qt4}
# Qt5 dependencies
BuildRequires: %{python_module qt5}
BuildRequires: %{python_module qt5-devel}
BuildRequires: %{python_module qt5}
# tk dependencies
BuildRequires: %{python_module tk}
BuildRequires: tcl
@@ -92,6 +110,7 @@ BuildRequires: %{python_module tornado}
# Wx dependencies (currently Python 2 only)
BuildRequires: python-wxWidgets
BuildRequires: wxWidgets-devel >= 3
%endif
Requires: python-Cycler
Requires: python-numpy >= 1.6
Requires: python-pyparsing >= 1.5.6
@@ -107,12 +126,11 @@ Recommends: libxml2-tools
Recommends: python-Pillow
Recommends: poppler-tools
Recommends: python-matplotlib-tk
# Change <= to < in next release after 2.0.0
Provides: python-matplotlib-gtk = %{version}
Obsoletes: python-matplotlib-gtk <= %{version}
Obsoletes: python-matplotlib-gtk < %{version}
%ifpython2
Provides: %{oldpython}-matplotlib-gtk = %{version}
Obsoletes: %{oldpython}-matplotlib-gtk <= %{version}
Obsoletes: %{oldpython}-matplotlib-gtk < %{version}
%endif
%python_subpackages
@@ -154,8 +172,10 @@ Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: texlive-dvipng
Requires: texlive-latex
Requires: texlive-sfmath
Requires: texlive-tex
%if 0%{?is_opensuse}
Requires: texlive-sfmath
%endif
%description latex
This package allows %{name} to display latex in plots
@@ -245,7 +265,11 @@ export XDG_RUNTIME_DIR=/tmp
%install
export XDG_RUNTIME_DIR=/tmp
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%{python_expand %fdupes %{buildroot}%{$python_sitearch}
$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/matplotlib/backends/qt_editor/
$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitearch}/matplotlib/backends/qt_editor/
%fdupes %{buildroot}%{$python_sitearch}/matplotlib/backends/qt_editor/
}
%if %{with tests}
%check
@@ -261,6 +285,7 @@ export XDG_RUNTIME_DIR=/tmp
%{python_sitearch}/mpl_toolkits
%{python_sitearch}/pylab.py*
%pycache_only %{python_sitearch}/__pycache__/pylab.*
%if 0%{?is_opensuse}
%exclude %{python_sitearch}/matplotlib/backends/backend_cairo.*
%exclude %{python_sitearch}/matplotlib/backends/backend_gtk3.*
%exclude %{python_sitearch}/matplotlib/backends/backend_gtk3agg.*
@@ -277,7 +302,9 @@ export XDG_RUNTIME_DIR=/tmp
%exclude %{python_sitearch}/matplotlib/backends/qt4_compat.*
%exclude %{python_sitearch}/matplotlib/backends/tkagg.*
%exclude %{python_sitearch}/matplotlib/backends/web_backend/
%endif
%ifpycache
%if 0%{?is_opensuse}
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_cairo.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3agg.*
@@ -293,12 +320,21 @@ export XDG_RUNTIME_DIR=/tmp
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/qt4_compat.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/tkagg.*
%endif
%endif
%ifpython2
%if 0%{?is_opensuse}
%exclude %{python_sitearch}/matplotlib/backends/backend_wx.py*
%exclude %{python_sitearch}/matplotlib/backends/backend_wxagg.py*
%exclude %{python_sitearch}/matplotlib/backends/wx_compat.py*
%endif
%endif
# Dummy package to pull in latex dependencies.
%files %{python_files latex}
%defattr(-,root,root,-)
%doc doc/users/usetex.rst
%if 0%{?is_opensuse}
%files %{python_files cairo}
%defattr(-,root,root,-)
@@ -314,12 +350,6 @@ export XDG_RUNTIME_DIR=/tmp
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3agg.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3cairo.*.py*
# Dummy package to pull in latex dependencies.
%files %{python_files latex}
%defattr(-,root,root,-)
%doc doc/users/usetex.rst
# IMPORTANT: the qt4 backend makes use of the qt5 backend,
# which is actually a generic qt backend.
# So we need to package all the qt5 stuff in a generic
@@ -368,4 +398,6 @@ export XDG_RUNTIME_DIR=/tmp
%{python2_sitearch}/matplotlib/backends/backend_wx.py*
%{python2_sitearch}/matplotlib/backends/backend_wxagg.py*
%endif
%changelog