1
0
python-matplotlib/python-matplotlib.spec

372 lines
14 KiB
RPMSpec

#
# spec file for package python-matplotlib
#
# 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/
#
#Not doing tests because they take too long
%bcond_with tests
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name: python-matplotlib
Version: 2.0.0
Release: 0
Summary: Plotting Library for Python
License: SUSE-Matplotlib
Group: Development/Libraries/Python
Url: http://matplotlib.org
Source: https://files.pythonhosted.org/packages/source/m/matplotlib/matplotlib-%{version}.tar.gz
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: 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 numpy >= 1.6}
BuildRequires: %{python_module numpy-devel >= 1.6}
BuildRequires: %{python_module pyparsing >= 1.5.6}
BuildRequires: %{python_module python-dateutil >= 1.1}
BuildRequires: %{python_module pytz}
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}
%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
BuildRequires: texlive-sfmath
# Qt4 dependencies
BuildRequires: %{python_module qt4}
BuildRequires: %{python_module qt4-devel}
# Qt5 dependencies
BuildRequires: %{python_module qt5}
BuildRequires: %{python_module qt5-devel}
# tk dependencies
BuildRequires: %{python_module tk}
BuildRequires: tcl
BuildRequires: tk
BuildRequires: pkgconfig(tcl)
BuildRequires: pkgconfig(tk)
# WebAgg dependencies
BuildRequires: %{python_module tornado}
# Wx dependencies (currently Python 2 only)
BuildRequires: python-wxWidgets
BuildRequires: wxWidgets-devel >= 3
Requires: python-Cycler
Requires: python-numpy >= 1.6
Requires: python-pyparsing >= 1.5.6
Requires: python-python-dateutil >= 1.1
Requires: python-pytz
Requires: python-six >= 1.3
%ifpython2
Requires: python-functools32
Requires: python-subprocess32
%endif
Recommends: ghostscript
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}
%ifpython2
Provides: %{oldpython}-matplotlib-gtk = %{version}
Obsoletes: %{oldpython}-matplotlib-gtk <= %{version}
%endif
%python_subpackages
%description
matplotlib is a python 2D plotting library which produces publication
quality figures in a variety of hardcopy formats and interactive
environments across platforms. matplotlib can be used in python
scripts, the python and ipython shell (ala matlab or mathematica), web
application servers, and six graphical user interface toolkits.
%package cairo
Summary: Cairo backend for %{name}
License: SUSE-Matplotlib
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: python-cairocffi
%description cairo
This package includes the non-interactive Cairo-based backend
for the %{name} plotting package
%package gtk3
Summary: GTK3 backends for %{name}
License: BSD-2-Clause
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: %{name}-cairo = %{version}
Requires: python-gobject
%description gtk3
This package includes the GTK3-based gtk3, gtk3agg, and
gtk3cairo backends for the %{name} plotting package
%package latex
Summary: Allow rendering latex in %{name}
License: BSD-2-Clause
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: texlive-dvipng
Requires: texlive-latex
Requires: texlive-sfmath
Requires: texlive-tex
%description latex
This package allows %{name} to display latex in plots
and figures.
%package qt-shared
Summary: Shared files for the Qt backends for %{name}
License: BSD-2-Clause
Group: Development/Libraries/Python
Requires: %{name} = %{version}
%description qt-shared
This package includes files needed by both the Qt4-based pyqt4 and
pyside backends and the Qt5-based pyqt5 backend for the %{name}
plotting package
%package qt4
Summary: Qt4 backends for %{name}
License: BSD-2-Clause
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: %{name}-qt-shared = %{version}
Requires: python-qt4 >= 4.0
%description qt4
This package includes the Qt4-based pyqt4 and pyside backends
for the %{name} plotting package
%package qt5
Summary: Qt5 backend for %{name}
License: BSD-2-Clause
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: %{name}-qt-shared = %{version}
Requires: python-qt5
%description qt5
This package includes the Qt5-based pyqt5 backend
for the %{name} plotting package
%package tk
Summary: Tk backend for %{name}
License: BSD-2-Clause
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: python-tk
Requires: tcl >= 8.3
%description tk
This package includes the Tk-based tkagg backend
for the %{name} plotting package
%package web
Summary: Web backend for %{name}
License: BSD-2-Clause
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: python-tornado
%description web
This package includes the browser-based webagg backend
for the %{name} plotting package
%package -n %{python2_prefix}-matplotlib-wx
Summary: WxWidgets backend for %{name}
License: BSD-2-Clause
Group: Development/Libraries/Python
Requires: %{name} = %{version}
Requires: python-wxWidgets >= 2.8
%description -n %{python2_prefix}-matplotlib-wx
This package includes the wxWidgets-based wxagg backend
for %{name} plotting package
%prep
%setup -q -n matplotlib-%{version}
%patch0 -p1
chmod -x lib/matplotlib/mpl-data/images/*.svg
find examples lib/matplotlib lib/mpl_toolkits/mplot3d -type f -name "*.py" -exec sed -i "s|#!\/usr\/bin\/env python||" {} \;
find examples lib/matplotlib lib/mpl_toolkits/mplot3d -type f -name "*.py" -exec sed -i "s|#!\/usr\/bin\/python||" {} \;
%build
cp %{SOURCE1} ./setup.cfg
export XDG_RUNTIME_DIR=/tmp
%python_build
%install
export XDG_RUNTIME_DIR=/tmp
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%if %{with tests}
%check
%python_exec tests.py
%endif
%files %{python_files}
%defattr(-,root,root,-)
%doc README.rst LICENSE CHANGELOG PKG-INFO examples doc/users/license.rst
%{python_sitearch}/matplotlib/
%{python_sitearch}/matplotlib-%{version}-py*.egg-info
%{python_sitearch}/matplotlib-%{version}-py*-nspkg.pth
%{python_sitearch}/mpl_toolkits
%{python_sitearch}/pylab.py*
%pycache_only %{python_sitearch}/__pycache__/pylab.*
%exclude %{python_sitearch}/matplotlib/backends/backend_cairo.*
%exclude %{python_sitearch}/matplotlib/backends/backend_gtk3.*
%exclude %{python_sitearch}/matplotlib/backends/backend_gtk3agg.*
%exclude %{python_sitearch}/matplotlib/backends/backend_gtk3cairo.*
%exclude %{python_sitearch}/matplotlib/backends/backend_qt4.py*
%exclude %{python_sitearch}/matplotlib/backends/backend_qt4agg.py*
%exclude %{python_sitearch}/matplotlib/backends/backend_qt5.*
%exclude %{python_sitearch}/matplotlib/backends/backend_qt5agg.*
%exclude %{python_sitearch}/matplotlib/backends/backend_tkagg.*
%exclude %{python_sitearch}/matplotlib/backends/backend_webagg.*
%exclude %{python_sitearch}/matplotlib/backends/backend_webagg_core.*
%exclude %{python_sitearch}/matplotlib/backends/qt_compat.*
%exclude %{python_sitearch}/matplotlib/backends/qt_editor/
%exclude %{python_sitearch}/matplotlib/backends/qt4_compat.*
%exclude %{python_sitearch}/matplotlib/backends/tkagg.*
%exclude %{python_sitearch}/matplotlib/backends/web_backend/
%ifpycache
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_cairo.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3agg.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3cairo.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt4.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt4agg.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5agg.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_tkagg.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg_core.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/qt_compat.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/qt4_compat.*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/tkagg.*
%endif
%ifpython2
%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
%files %{python_files cairo}
%defattr(-,root,root,-)
%{python_sitearch}/matplotlib/backends/backend_cairo.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_cairo.*.py*
%files %{python_files gtk3}
%defattr(-,root,root,-)
%{python_sitearch}/matplotlib/backends/backend_gtk3.py*
%{python_sitearch}/matplotlib/backends/backend_gtk3agg.py*
%{python_sitearch}/matplotlib/backends/backend_gtk3cairo.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3.*.py*
%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
# package, and provide the -1t5 stub package which pulls in
# the python-qt5 dependency.
%files %{python_files qt-shared}
%defattr(-,root,root,-)
%{python_sitearch}/matplotlib/backends/backend_qt5.py*
%{python_sitearch}/matplotlib/backends/backend_qt5agg.py*
%{python_sitearch}/matplotlib/backends/qt4_compat.py*
%{python_sitearch}/matplotlib/backends/qt_compat.py*
%{python_sitearch}/matplotlib/backends/qt_editor/
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5agg.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/qt4_compat.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/qt_compat.*.py*
%files %{python_files qt4}
%{python_sitearch}/matplotlib/backends/backend_qt4.py*
%{python_sitearch}/matplotlib/backends/backend_qt4agg.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt4.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt4agg.*.py*
%files %{python_files qt5}
%defattr(-,root,root,-)
%doc README.rst
%files %{python_files tk}
%defattr(-,root,root,-)
%{python_sitearch}/matplotlib/backends/backend_tkagg.py*
%{python_sitearch}/matplotlib/backends/tkagg.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_tkagg.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/tkagg.*.py*
%files %{python_files web}
%defattr(-,root,root,-)
%{python_sitearch}/matplotlib/backends/backend_webagg.py*
%{python_sitearch}/matplotlib/backends/backend_webagg_core.py*
%{python_sitearch}/matplotlib/backends/web_backend/
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg_core.*.py*
%files -n %{python2_prefix}-matplotlib-wx
%defattr(-,root,root,-)
%{python2_sitearch}/matplotlib/backends/wx_compat.py*
%{python2_sitearch}/matplotlib/backends/backend_wx.py*
%{python2_sitearch}/matplotlib/backends/backend_wxagg.py*
%changelog