# Generated by rust2rpm 22
%bcond_without check
%global crate tealdeer
Name: rust-tealdeer
Version: 1.5.0
Release: %autorelease
Summary: Fetch and show tldr help pages for many CLI commands
# Upstream license specification: MIT/Apache-2.0
License: MIT OR Apache-2.0
URL: https://crates.io/crates/tealdeer
Source0: %{crates_source}
Source1: LICENSE.dependencies
# Manually created patch for downstream crate metadata changes
# * keep using app_dirs instead of app_dirs2 fork
# * relax clap dependency from "=3.0.0-rc.11" to "3"
# * use native-tls instead of rustls in reqwest
Patch: tealdeer-fix-metadata.diff
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging >= 21
%global _description %{expand:
Fetch and show tldr help pages for many CLI commands. Full featured offline
client with caching support.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
# (ASL 2.0 or MIT) and BSD
# 0BSD or MIT or ASL 2.0
# ASL 2.0
# ASL 2.0 or Boost
# ASL 2.0 or MIT
# MIT
# MIT or ASL 2.0
# MIT or ASL 2.0 or zlib
# MIT or zlib or ASL 2.0
# Unlicense or MIT
# zlib or ASL 2.0 or MIT
License: ASL 2.0 and BSD and MIT
# LICENSE.dependencies contains a full license breakdown
%description -n %{crate} %{_description}
%files -n %{crate}
%license LICENSE-APACHE
%license LICENSE-MIT
%license LICENSE.dependencies
%doc README.md
%{_bindir}/tldr
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/tldr.bash
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%{_datadir}/fish/vendor_completions.d/tldr.fish
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
cp %{SOURCE1} .
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%build
%cargo_build
%install
%cargo_install
install -Dpm0644 bash_tealdeer %{buildroot}%{_datadir}/bash-completion/completions/tldr.bash
install -Dpm0644 fish_tealdeer %{buildroot}%{_datadir}/fish/vendor_completions.d/tldr.fish
%if %{with check}
%check
# integration tests need a working internet connection
%cargo_test -- --bins
%endif
%changelog
%autochangelog