File luwen.spec of Package luwen

#
# spec file for package luwen
#
# Copyright (c) 2024 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/
#

%define skip_python2 1

Name:           luwen
Version:        0.4.3
%define pver    0.6.0
Release:        0
Summary:        Luwen
License:        Apache-2.0
Group:          System/Kernel
URL:            https://github.com/tenstorrent/luwen
Source0:        https://github.com/tenstorrent/luwen/archive/refs/tags/v%{version}.tar.gz#/luwen-%{version}.tar.gz
Source1:        vendor.tar.zst
BuildRequires:  cargo-packaging
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module maturin}

%define python_subpackage_only 1
%python_subpackages

%description
This package contains Luwen.

%package -n python-pyluwen
Version:        %{pver}
Summary:        Python bindings for Luwen

%description -n python-pyluwen
This package contains Python bindings for Luwen.

%prep
%autosetup -p1 -a1

%build
%{cargo_build} --all --exclude pyluwen
pushd crates/pyluwen
%pyproject_wheel
popd

%install
%{cargo_install}
pushd crates/pyluwen
%pyproject_install
%python_expand maturin-%{$python_version} build --release
%python3_fix_shebang
%python_expand %fdupes %{buildroot}%{$python_sitearch}/pyluwen
popd

%files
%license LICENSE
%{_bindir}/detect_test
%{_bindir}/druken_monkey
%{_bindir}/ethernet_benchmark
%{_bindir}/generate_names
%{_bindir}/luwen-cem
%{_bindir}/luwen-demo
%{_bindir}/read-write-test
%{_bindir}/reset-test
%{_bindir}/spi-test
%{_bindir}/telem_funtest
%{_bindir}/telem_test

%files %{python_files pyluwen}
%{python_sitearch}/pyluwen
%{python_sitearch}/pyluwen-%{pver}.dist-info

%changelog
openSUSE Build Service is sponsored by