1
0

- Switch to multibuild to not cycle

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-imagecodecs?expand=0&rev=10
This commit is contained in:
Tomáš Chvátal
2020-08-28 09:21:22 +00:00
committed by Git OBS Bridge
parent c232204244
commit 88299ee7fe
3 changed files with 46 additions and 18 deletions

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Aug 28 09:20:47 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Switch to multibuild to not cycle
-------------------------------------------------------------------
Fri Aug 28 08:37:24 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -17,8 +17,16 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%define skip_python2 1
Name: python-imagecodecs
Name: python-imagecodecs%{psuffix}
Version: 2020.5.30
Release: 0
Summary: Image transformation, compression, and decompression codecs
@@ -28,18 +36,30 @@ Source: https://files.pythonhosted.org/packages/source/i/imagecodecs/ima
Patch0: always-cythonize.patch
Patch1: zopfli-headers.patch
BuildRequires: %{python_module Cython >= 0.29.19}
BuildRequires: %{python_module Pillow}
BuildRequires: %{python_module blosc}
BuildRequires: %{python_module lz4}
BuildRequires: %{python_module matplotlib >= 2.2}
BuildRequires: %{python_module numpy-devel >= 1.15.1}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module scikit-image}
BuildRequires: %{python_module setuptools >= 18.0}
BuildRequires: %{python_module tifffile >= 2020.5.25}
BuildRequires: %{python_module zstd}
BuildRequires: dos2unix
BuildRequires: fdupes
Requires: python-numpy >= 1.15.1
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-Pillow
Recommends: python-blosc
Recommends: python-lz4
Recommends: python-matplotlib >= 3.1
Recommends: python-tifffile >= 2020.5.25
Recommends: python-zstd
%if %{with test}
BuildRequires: %{python_module Pillow}
BuildRequires: %{python_module blosc}
BuildRequires: %{python_module imagecodecs >= %{version}}
BuildRequires: %{python_module lz4}
BuildRequires: %{python_module matplotlib >= 3.1}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module scikit-image}
BuildRequires: %{python_module tifffile >= 2020.5.25}
BuildRequires: %{python_module zstd}
%else
BuildRequires: gcc-c++
BuildRequires: giflib-devel
BuildRequires: jxrlib-devel
@@ -61,15 +81,7 @@ BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(zlib)
Requires: python-numpy >= 1.15.1
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-Pillow
Recommends: python-blosc
Recommends: python-lz4
Recommends: python-matplotlib >= 3.1
Recommends: python-tifffile >= 2020.5.25
Recommends: python-zstd
%endif
%python_subpackages
%description
@@ -89,23 +101,30 @@ Delta, XOR Delta, Floating Point Predictor, and Bitorder reversal.
dos2unix README.rst
%build
%if !%{with test}
export CFLAGS="%{optflags}"
%python_build
%endif
%install
%if !%{with test}
%python_install
%python_clone -a %{buildroot}%{_bindir}/imagecodecs
%{python_expand rm -rf %{buildroot}%{$python_sitearch}/imagecodecs/licenses/
%fdupes %{buildroot}%{$python_sitearch}
}
%endif
%check
%if %{with test}
mv imagecodecs __imagecodecs
# Should add --doctest-modules %%{buildroot}%%{$python_sitearch}/imagecodecs/imagecodecs.py
# however doctests are currently broken
%pytest_arch tests
mv __imagecodecs imagecodecs
%endif
%if !%{with test}
%post
%python_install_alternative imagecodecs
@@ -117,5 +136,6 @@ mv __imagecodecs imagecodecs
%doc README.rst
%python_alternative %{_bindir}/imagecodecs
%{python_sitearch}/*
%endif
%changelog