File python-osmium.spec of Package python-osmium

#
# spec file for package python-osmium
#
# Copyright (c) 2023 SUSE LLC
#
# 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/
#

%{?sle15_python_module_pythons}
Name:           python-osmium
Version:        4.1.1
Release:        0
Summary:        Python bindings for libosmium, a processing library for OpenStreetMap data
License:        BSD-2-Clause
URL:            https://osmcode.org/pyosmium
Source:         osmium-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module pybind11-devel >= 2.2.0}
BuildRequires:  %{python_module scikit-build-core}
BuildRequires:  fdupes
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  libexpat-devel
BuildRequires:  libbz2-devel
BuildRequires:  zlib-devel
BuildRequires:  liblz4-devel
BuildRequires:  boost-devel
BuildRequires:  libosmium-devel
BuildRequires:  protozero-devel
Requires:       python-requests
Requires(post): update-alternatives
%python_subpackages

%description
Python bindings for libosmium, the data processing library for OpenStreetMap data

%prep
%autosetup -n pyosmium-%{version}

%build
export CFLAGS="%{optflags}"
export CMAKE_POLICY_VERSION_MINIMUM=3.5
%pyproject_wheel

%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/pyosmium-get-changes
%python_clone -a %{buildroot}%{_bindir}/pyosmium-up-to-date
%python_expand %fdupes %{buildroot}%{$python_sitearch}

%post
%python_install_alternative pyosmium-get-changes pyosmium-up-to-date

%postun
%python_uninstall_alternative pyosmium-get-changes

# test not active as required input files are not included in the package
# #check
# #pytest_arch test

%files %{python_files}
%doc CHANGELOG.md README.md README.rst
%license LICENSE.TXT
%python_alternative %{_bindir}/pyosmium-get-changes
%python_alternative %{_bindir}/pyosmium-up-to-date
%{python_sitearch}/osmium
%{python_sitearch}/osmium-%{version}.dist-info

%changelog
openSUSE Build Service is sponsored by