Blob Blame History Raw
%if 0%{?fedora} > 12
%global with_python3 1
%endif

Name:           openslide-python
Version:        1.0.1
Release:        1%{?dist}
Summary:        Python bindings for the OpenSlide library

Group:          System Environment/Libraries
License:        LGPLv2
URL:            http://openslide.org/
Source0:        https://github.com/openslide/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz

# Disable Intersphinx so it won't download inventories at build time
Patch0:         openslide-python-1.0.1-disable-intersphinx.patch

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python-sphinx
%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
%endif # with_python3

Requires:       openslide >= 3.4.0
Requires:       python-pillow

%description
The OpenSlide library allows programs to access virtual slide files
regardless of the underlying image format.  This package allows Python
programs to use OpenSlide.


%if 0%{?with_python3}
%package -n openslide-python3
Summary:        Python 3 bindings for the OpenSlide library
Requires:       openslide >= 3.4.0
Requires:       python3-pillow


%description -n openslide-python3
The OpenSlide library allows programs to access virtual slide files
regardless of the underlying image format.  This package allows Python 3
programs to use OpenSlide.
%endif # with_python3

%prep
%setup -q
%patch0 -p1

# Examples include bundled jQuery and OpenSeadragon
rm -rf examples

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3


%build
%{__python2} setup.py build

%{__python2} setup.py build_sphinx
rm build/sphinx/html/.buildinfo

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3


%install
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
popd
%endif # with_python3


%files
%doc CHANGELOG.txt LICENSE.txt lgpl-2.1.txt build/sphinx/html
%{python2_sitelib}/*


%if 0%{?with_python3}
%files -n openslide-python3
%doc CHANGELOG.txt LICENSE.txt lgpl-2.1.txt build/sphinx/html
%{python3_sitelib}/*
%endif # with_python3


%changelog
* Mon Mar 10 2014 Benjamin Gilbert <bgilbert@backtick.net> - 1.0.1-1
- New release
- Use versioned sitelib macro for Python 2

* Tue Feb 11 2014 Benjamin Gilbert <bgilbert@backtick.net> - 0.5.1-1
- Initial version