rust-fd-find/rust-fd-find.spec

88 lines
2.3 KiB
RPMSpec

# Generated by rust2rpm 24
%bcond_without check
%global crate fd-find
Name: rust-fd-find
Version: 8.7.0
Release: %autorelease
Summary: Fd is a simple, fast and user-friendly alternative to find
# Upstream license specification: MIT/Apache-2.0
License: MIT OR Apache-2.0
URL: https://crates.io/crates/fd-find
Source: %{crates_source}
# Manually created patch for downstream crate metadata changes
# * drop jemallocator dependency
# * remove stabilized but previously unstable "clap/unstable-grouped" feature
Patch: fd-find-fix-metadata.diff
# * drop jemallocator from code
Patch: 0001-Remove-usage-of-jemallocator.patch
BuildRequires: rust-packaging >= 23
%global _description %{expand:
Fd is a simple, fast and user-friendly alternative to find.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
# Apache-2.0 OR MIT
# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
# MIT
# MIT OR Apache-2.0
# Unlicense OR MIT
License: 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 CHANGELOG.md
%doc CONTRIBUTING.md
%doc README.md
%{_bindir}/fd
%{_mandir}/man1/fd.1*
%{bash_completions_dir}/fd
%{fish_completions_dir}/fd.fish
%{zsh_completions_dir}/_fd
%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
# generate shell completions
./target/release/fd --gen-completions bash > fd.bash
./target/release/fd --gen-completions fish > fd.fish
./target/release/fd --gen-completions zsh > fd.zsh
%install
%cargo_install
# install manpage
install -Dpm 644 doc/fd.1 -t %{buildroot}/%{_mandir}/man1/
# install shell completions
install -Dpm 0644 fd.bash %{buildroot}/%{bash_completions_dir}/fd
install -Dpm 0644 fd.fish %{buildroot}/%{fish_completions_dir}/fd.fish
install -Dpm 0644 fd.zsh %{buildroot}/%{zsh_completions_dir}/_fd
%if %{with check}
%check
%cargo_test
%endif
%changelog
%autochangelog