Blob Blame History Raw
# Generated by rust2rpm 24
%bcond_without check

%global crate bodhi-cli

# reduce debuginfo verbosity to work around rustc OOM problems on 32-bit arches
%global rustflags_debuginfo 1

Name:           rust-bodhi-cli
Version:        2.1.0
Release:        %autorelease
Summary:        Bodhi CLI client based on bodhi-rs

License:        MIT OR Apache-2.0
URL:            https://crates.io/crates/bodhi-cli
Source:         %{crates_source}

BuildRequires:  rust-packaging >= 23

%global _description %{expand:
Bodhi CLI client based on bodhi-rs.}

%description %{_description}

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

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

%files       -n %{crate}
%license LICENSE-APACHE
%license LICENSE-MIT
%license LICENSE.dependencies
%doc NEWS.md
%doc README.md
%{_bindir}/bodhi-cli
%{bash_completions_dir}/bodhi-cli.bash
%{fish_completions_dir}/bodhi-cli.fish
%{zsh_completions_dir}/_bodhi-cli

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

%generate_buildrequires
%cargo_generate_buildrequires

%build
%cargo_build
# write license summary and breakdown
%cargo_license_summary
%{cargo_license} > LICENSE.dependencies

%install
%cargo_install
# install shell completions
install -Dpm 0644 target/release/build/%{crate}-*/out/bodhi-cli.bash \
    %{buildroot}/%{bash_completions_dir}/bodhi-cli.bash
install -Dpm 0644 target/release/build/%{crate}-*/out/bodhi-cli.fish \
    %{buildroot}/%{fish_completions_dir}/bodhi-cli.fish
install -Dpm 0644 target/release/build/%{crate}-*/out/_bodhi-cli \
    %{buildroot}/%{zsh_completions_dir}/_bodhi-cli

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

%changelog
%autochangelog