rust-hyperfine/rust-hyperfine.spec

105 lines
2.6 KiB
RPMSpec

# Generated by rust2rpm 22
%bcond_without check
%global crate hyperfine
%if 0%{?el8}
# el8 doesn't have these macros
%global __crates_url https://crates.io/api/v1/crates/
%global crates_source %{__crates_url}%{crate}/%{version}/download#/%{crate}-%{version}.crate
%global version_no_tilde %{version}
%endif
Name: rust-hyperfine
Version: 1.14.0
Release: %autorelease
Summary: Command-line benchmarking tool
# Upstream license specification: MIT/Apache-2.0
License: MIT OR Apache-2.0
URL: https://crates.io/crates/hyperfine
Source0: %{crates_source}
Source1: LICENSE.dependencies
# vendored dependencies for EPEL
Source100: %{crate}-%{version}-vendor.tar.xz
# Automatically generated patch to strip foreign dependencies
Patch: hyperfine-fix-metadata-auto.diff
ExclusiveArch: %{rust_arches}
%if 0%{?el8}
BuildRequires: rust-toolset
%else
BuildRequires: rust-packaging >= 21
%endif
%global _description %{expand:
Command-line benchmarking tool.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
# Apache-2.0 OR BSL-1.0
# Apache-2.0 OR MIT
# MIT
# MIT OR Apache-2.0
# MPL-2.0
# Unlicense OR MIT
License: MIT AND MPL-2.0 AND (Apache-2.0 OR BSL-1.0)
# 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 README.md
%{_bindir}/hyperfine
%{_mandir}/man1/hyperfine.1*
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/hyperfine.bash
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%{_datadir}/fish/vendor_completions.d/hyperfine.fish
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_hyperfine
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
cp %{SOURCE1} .
%if 0%{?el8}
%cargo_prep -V 100
%else
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%endif
%build
%cargo_build
%install
%cargo_install
install -Dpm0644 -t %{buildroot}%{_mandir}/man1 \
doc/hyperfine.1
install -Dpm0644 -t %{buildroot}%{_datadir}/bash-completion/completions \
target/release/build/%{crate}-*/out/hyperfine.bash
install -Dpm0644 -t %{buildroot}%{_datadir}/fish/vendor_completions.d \
target/release/build/%{crate}-*/out/hyperfine.fish
install -Dpm0644 -t %{buildroot}%{_datadir}/zsh/site-functions \
target/release/build/%{crate}-*/out/_hyperfine
%if %{with check}
%check
%cargo_test
%endif
%changelog
%autochangelog