# Generated by rust2rpm 27
%bcond check 1

%global crate usage-cli

Name:           rust-usage-cli
Version:        3.3.0
Release:        1%{?dist}
Summary:        CLI for working with usage-based CLIs

License:        MIT
URL:            https://crates.io/crates/usage-cli
Source:         %{crates_source}
Source1:        https://raw.githubusercontent.com/jdx/usage/refs/tags/v%version/LICENSE
Packager:       madonuko <mado@fyralabs.com>

BuildRequires:  cargo-rpm-macros >= 24

%global _description %{expand:
CLI for working with usage-based CLIs.}

%description %{_description}

%package     -n %{crate}
Summary:        %{summary}
License:        (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND ISC AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT)
# LICENSE.dependencies contains a full license breakdown
Provides:		usage = %version-%release

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

%files       -n %{crate}
%license LICENSE
%license LICENSE.dependencies
%{_bindir}/usage

%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
%{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 %{S:1} .
%cargo_prep_online

%build
%{cargo_license_summary_online}
%{cargo_license_online} > LICENSE.dependencies

%install
%cargo_install

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