# Generated by rust2rpm 24
%bcond_without check

%global crate vhost-device-scmi

Name:           rust-vhost-device-scmi
Version:        0.1.0
Release:        %autorelease
Summary:        Vhost-user SCMI backend device

License:        Apache-2.0 OR BSD-3-Clause
URL:            https://crates.io/crates/vhost-device-scmi
Source:         %{crates_source}
# Upstream doesn't provide man pages
Patch0:         rust-vhost-device-scmi-man-page.patch

BuildRequires:  rust-packaging >= 23

%global _description %{expand:
Vhost-user SCMI backend device.}

%description %{_description}

%package     -n %{crate}
Summary:        %{summary}
License:        (Apache-2.0 OR BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND Apache-2.0 AND BSD-3-Clause AND MIT AND (Unlicense OR MIT)
# LICENSE.dependencies contains a full license breakdown

%description -n %{crate} %{_description}

%files       -n %{crate}
%license LICENSE-APACHE
%license LICENSE-BSD-3-Clause
%license LICENSE.dependencies
%doc CHANGELOG.md
%doc README.md
%{_bindir}/vhost-device-scmi
%{_mandir}/man1/*

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

%generate_buildrequires
%cargo_generate_buildrequires

%build
%cargo_build
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies

%install
%cargo_install
mkdir -p %{buildroot}/%{_mandir}/man1
install -m 644 vhost-device-scmi.1 %{buildroot}/%{_mandir}/man1/

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

%changelog
%autochangelog