# Generated by rust2rpm 25 %bcond_without check %global debug_package %{nil} %global crate safetensors Name: rust-safetensors Version: 0.4.1 Release: %autorelease Summary: Functions for safer PyTorch safetensors read/write operations License: Apache-2.0 URL: https://crates.io/crates/safetensors Source: %{crates_source} # Manually created patch for downstream crate metadata changes Patch: safetensors-fix-metadata.diff # LICENSE is not included in the source # PR for fix https://github.com/huggingface/safetensors/pull/416 Source1: https://github.com/huggingface/%{crate}/raw/v%{version}/LICENSE BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: Provides functions to read and write safetensors which aim to be safer than their PyTorch counterpart. The format is 8 bytes which is an unsized int, being the size of a JSON header, the JSON header refers the `dtype` the `shape` and `data_offsets` which are the offsets for the values in the rest of the file.} %description %{_description} %package devel Summary: %{summary} BuildArch: noarch %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license LICENSE %doc %{crate_instdir}/README.md %{crate_instdir}/ %package -n %{name}+default-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+default-devel %{_description} This package contains library source intended for building other packages which use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 cp -p '%{SOURCE1}' . %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %install %cargo_install %if %{with check} %check %cargo_test %endif %changelog %autochangelog