Blob Blame History Raw
%global srcname pyqtgraph
%global py2_deps PyQt4 numpy PyOpenGL
%global py3_deps python3-PyQt4 python3-numpy python3-PyOpenGL
%global sum Scientific Graphics and GUI Library for Python
%global desc \
PyQtGraph is a pure-python graphics and GUI library built on PyQt4 / PySide and\
numpy. It is intended for use in mathematics / scientific /engineering \
applications. Despite being written entirely in python, the library is very \
fast due to its heavy leverage of numpy for number crunching and Qt\'s \
GraphicsView framework for fast display.

Name:           python-%{srcname}
Version:        0.9.10
Release:        4%{?dist}
Summary:        %{sum}
License:        MIT
URL:            http://www.pyqtgraph.org/
Source0:        http://www.pyqtgraph.org/downloads/%{srcname}-%{version}.tar.gz
Patch0:         pyqtgraph-0.9.10-disable-failing-tests.patch
Patch1:         pyqtgraph-0.9.10-fix-pytest-path.patch
Patch2:         pyqtgraph-0.9.10-testfixes.patch

BuildArch:      noarch
BuildRequires:  python2-devel python3-devel
# For Tests
BuildRequires:  pytest python3-pytest python-six python3-six
BuildRequires:  xorg-x11-server-Xvfb %{py2_deps} %{py3_deps}

%description %{desc}


%package -n python2-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python2-%{srcname}}
Requires:       %{py2_deps}

%description -n python2-%{srcname} %{desc}

%package -n python3-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python3-%{srcname}}
Requires:       %{py3_deps}

%description -n python3-%{srcname} %{desc}

%package doc
Summary:        Documentation for the %{srcname} library

%description doc
This package provides documentation for the %{srcname} library.

%prep
%autosetup -p1 -n %{srcname}-%{version}

%build
%py2_build
%py3_build

%install
%py2_install
%py3_install
rm -rf %{buildroot}/%{python2_sitelib}/pyqtgraph/examples
rm -rf %{buildroot}/%{python3_sitelib}/pyqtgraph/examples
rm -f doc/build/html/.buildinfo
rm -f doc/build/html/objects.inv

%check
xvfb-run -a %{__python2} setup.py test
xvfb-run -a %{__python3} setup.py test

%files -n python2-%{srcname}
%license LICENSE.txt
%doc CHANGELOG README.md
%{python2_sitelib}/*

%files -n python3-%{srcname}
%license LICENSE.txt
%doc CHANGELOG README.md
%{python3_sitelib}/*

%files doc
%doc examples doc/build/html

%changelog
* Fri Aug 07 2015 Scott Talbert <swt@techie.net> - 0.9.10-4
- Moved documentation to subpackage

* Tue Aug 04 2015 Scott Talbert <swt@techie.net> - 0.9.10-3
- Fix and run tests, move examples to docs, add docs

* Sun Aug 02 2015 Scott Talbert <swt@techie.net> - 0.9.10-2
- Build python2 package also; update to latest python packaging standards

* Fri Jul 31 2015 Scott Talbert <swt@techie.net> 0.9.10-1
- Initial packaging.