File rust-cgmath.spec of Package rust-cgmath

#
# spec file for package rust-cgmath
#
# Copyright (c) 2024 Your Name <you@example.com>.
#
# 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/
#

# Generated by rust2rpm 26
%bcond_without check
%global debug_package %{nil}

%global crate cgmath

Name:           rust-cgmath
Version:        0.18.0
Release:        0
Summary:        Linear algebra and mathematics library for computer graphics
Group:          Development/Libraries/Rust

License:        Apache-2.0
URL:            https://crates.io/crates/cgmath
Source:         https://crates.io/api/v1/crates/%crate/%version/download#/%crate-%version.crate
# PATCH-FIX-OPENSUSE cgmath-fix-metadata.diff — Manually created patch for downstream crate metadata changes
Patch:          cgmath-fix-metadata.diff

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging >= 21
BuildRequires:  (crate(approx/default) >= 0.5.0 with crate(approx/default) < 0.6.0~)
BuildRequires:  (crate(num-traits/default) >= 0.2.0 with crate(num-traits/default) < 0.3.0~)
%if %{with check}
BuildRequires:  (crate(serde_json/default) >= 1.0.0 with crate(serde_json/default) < 2.0.0~)
%endif

%global _description %{expand:
A linear algebra and mathematics library for computer graphics.}

%description %{_description}

%package        devel
Summary:        %{summary}
Group:          Development/Libraries/Rust
BuildArch:      noarch

%description    devel %{_description}

This package contains library source intended for building other packages which
use the "%{crate}" crate.

%files          devel
%license %{crate_instdir}/LICENSE
%doc %{crate_instdir}/CHANGELOG.md
%doc %{crate_instdir}/README.md
%{crate_instdir}/

%package     -n %{name}+default-devel
Summary:        %{summary}
Group:          Development/Libraries/Rust
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

%package     -n %{name}+mint-devel
Summary:        %{summary}
Group:          Development/Libraries/Rust
BuildArch:      noarch

%description -n %{name}+mint-devel %{_description}

This package contains library source intended for building other packages which
use the "mint" feature of the "%{crate}" crate.

%files       -n %{name}+mint-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+rand-devel
Summary:        %{summary}
Group:          Development/Libraries/Rust
BuildArch:      noarch

%description -n %{name}+rand-devel %{_description}

This package contains library source intended for building other packages which
use the "rand" feature of the "%{crate}" crate.

%files       -n %{name}+rand-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+serde-devel
Summary:        %{summary}
Group:          Development/Libraries/Rust
BuildArch:      noarch

%description -n %{name}+serde-devel %{_description}

This package contains library source intended for building other packages which
use the "serde" feature of the "%{crate}" crate.

%files       -n %{name}+serde-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+swizzle-devel
Summary:        %{summary}
Group:          Development/Libraries/Rust
BuildArch:      noarch

%description -n %{name}+swizzle-devel %{_description}

This package contains library source intended for building other packages which
use the "swizzle" feature of the "%{crate}" crate.

%files       -n %{name}+swizzle-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+unstable-devel
Summary:        %{summary}
Group:          Development/Libraries/Rust
BuildArch:      noarch

%description -n %{name}+unstable-devel %{_description}

This package contains library source intended for building other packages which
use the "unstable" feature of the "%{crate}" crate.

%files       -n %{name}+unstable-devel
%ghost %{crate_instdir}/Cargo.toml

%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep

%build
%cargo_build

%install
%cargo_install

%if %{with check}
%check
%cargo_test
%endif

%changelog
* Tue Apr 23 16:34:41 EAT 2024 Your Name <you@example.com>
- Version 0.18.0
- Initial package
openSUSE Build Service is sponsored by