2021-05-19 05:31:18 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-cramjam
|
|
|
|
#
|
2024-02-19 14:30:20 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2021-05-19 05:31:18 +00:00
|
|
|
#
|
|
|
|
# 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 https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2024-02-19 14:30:20 +00:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%bcond_without test
|
|
|
|
%define psuffix -test
|
|
|
|
%else
|
|
|
|
%bcond_with test
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Adjust the version in _service and use `rm -rf cramjam; osc service runall` in order to update
|
|
|
|
%define modname cramjam
|
2024-08-14 15:11:17 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2024-02-19 14:30:20 +00:00
|
|
|
Name: python-cramjam%{psuffix}
|
2024-12-19 08:20:12 +00:00
|
|
|
Version: 2.9.1
|
2021-05-19 05:31:18 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Thin Python bindings to de/compression algorithms in Rust
|
|
|
|
License: MIT
|
2024-02-19 14:30:20 +00:00
|
|
|
URL: https://github.com/milesgranger/cramjam
|
|
|
|
Source: %{modname}-%{version}.tar.xz
|
2021-05-19 05:31:18 +00:00
|
|
|
Source1: vendor.tar.xz
|
2024-12-19 08:20:12 +00:00
|
|
|
# PATCH-FEATURE-OPENSUSE cramjam-opensuse-config.patch code@bnavigator.de -- Use system libraries and avoid static linking
|
|
|
|
Patch0: cramjam-opensuse-config.patch
|
|
|
|
# PATCH-FIX-UPSTREAM cramjam-issue193-test_variants.patch gh#milesgranger/cramjam#193
|
|
|
|
Patch1: cramjam-issue193-test_variants.patch
|
|
|
|
BuildRequires: %{python_module base >= 3.8}
|
2022-10-29 11:44:47 +00:00
|
|
|
BuildRequires: %{python_module maturin >= 0.13}
|
2021-07-19 20:31:59 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2024-12-19 08:20:12 +00:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
2021-09-28 05:47:51 +00:00
|
|
|
BuildRequires: cargo-packaging
|
2024-12-19 08:20:12 +00:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: libtool
|
|
|
|
BuildRequires: nasm
|
2021-07-19 20:31:59 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2024-12-19 08:20:12 +00:00
|
|
|
BuildRequires: pkgconfig(blosc2)
|
|
|
|
BuildRequires: pkgconfig(libisal)
|
|
|
|
BuildRequires: pkgconfig(libzstd)
|
2021-05-19 05:31:18 +00:00
|
|
|
# SECTION test dependencies
|
2024-02-19 14:30:20 +00:00
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module %{modname} = %{version}}
|
2022-10-29 11:44:47 +00:00
|
|
|
BuildRequires: %{python_module hypothesis}
|
2024-02-19 14:30:20 +00:00
|
|
|
BuildRequires: %{python_module memory_profiler}
|
2021-05-19 05:31:18 +00:00
|
|
|
BuildRequires: %{python_module numpy}
|
2024-12-19 08:20:12 +00:00
|
|
|
BuildRequires: %{python_module pytest-xdist}
|
2021-05-19 05:31:18 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2024-02-19 14:30:20 +00:00
|
|
|
%endif
|
2021-05-19 05:31:18 +00:00
|
|
|
# /SECTION
|
|
|
|
BuildRequires: fdupes
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
Extremely thin Python bindings to de/compression algorithms in Rust.
|
|
|
|
Allows for using algorithms such as Snappy, without any system dependencies.
|
|
|
|
|
|
|
|
%prep
|
2024-12-19 08:20:12 +00:00
|
|
|
%autosetup -p1 -n %{modname}-%{version} -a1
|
2021-05-19 05:31:18 +00:00
|
|
|
|
|
|
|
%build
|
2024-02-19 14:30:20 +00:00
|
|
|
%if %{without test}
|
2024-12-19 08:20:12 +00:00
|
|
|
export ZSTD_SYS_USE_PKG_CONFIG=1
|
2021-05-19 05:31:18 +00:00
|
|
|
%pyproject_wheel
|
2024-02-19 14:30:20 +00:00
|
|
|
%endif
|
2021-05-19 05:31:18 +00:00
|
|
|
|
|
|
|
%install
|
2024-02-19 14:30:20 +00:00
|
|
|
%if %{without test}
|
2021-05-19 05:31:18 +00:00
|
|
|
%pyproject_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
2024-02-19 14:30:20 +00:00
|
|
|
%endif
|
2021-05-19 05:31:18 +00:00
|
|
|
|
|
|
|
%check
|
2024-02-19 14:30:20 +00:00
|
|
|
%if %{with test}
|
2024-12-19 08:20:12 +00:00
|
|
|
%pytest_arch -n auto --ignore benchmarks
|
2024-02-19 14:30:20 +00:00
|
|
|
%endif
|
2021-05-19 05:31:18 +00:00
|
|
|
|
2024-02-19 14:30:20 +00:00
|
|
|
%if %{without test}
|
2021-05-19 05:31:18 +00:00
|
|
|
%files %{python_files}
|
|
|
|
%license LICENSE
|
2024-02-19 14:30:20 +00:00
|
|
|
%{python_sitearch}/%{modname}
|
|
|
|
%{python_sitearch}/%{modname}-%{version}.dist-info
|
|
|
|
%endif
|
2021-05-19 05:31:18 +00:00
|
|
|
|
2021-07-19 20:31:59 +00:00
|
|
|
%changelog
|