File python-blosc.spec of Package python-blosc

# spec file for package python-blosc
# Copyright (c) 2018 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

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-blosc
Version:        1.8.1
Release:        0
Summary:        Blosc data compressor for Python
License:        MIT
Group:          Development/Languages/Python
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module nose}
BuildRequires:  %{python_module numpy-devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  blosc-devel >= 1.9.0
BuildRequires:  c++_compiler
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
# SECTION test requirements
BuildRequires:  %{python_module nose}
BuildRequires:  %{python_module numpy}
BuildRequires:  %{python_module psutil}
Requires:       blosc-devel
Recommends:     python-numpy
ExclusiveArch:  %ix86 x86_64

Blosc is a high performance compressor optimized for binary data in

%setup -q -n blosc-%{version}

export CFLAGS="%{optflags}"
%python_exec build_ext --inplace --blosc=%{_prefix}
%python_exec build --blosc=%{_prefix}

%python_exec install -O1 --skip-build --force --root=%{buildroot} --prefix=%{_prefix} --blosc=%{_prefix}
%python_expand %fdupes %{buildroot}%{$python_sitearch}

mkdir empty
pushd empty
%{python_expand export PYTHONDONTWRITEBYTECODE=1
export PYTHONPATH=%{buildroot}%{$python_sitearch}
$python -c "import blosc; blosc.print_versions()"
nosetests-%{$python_bin_suffix} blosc

%files %{python_files}
%license LICENSES/*.txt