summaryrefslogtreecommitdiff
path: root/rust-ripgrep.spec
blob: b1906f5b0fa3f9aaf78572e0727ed5038fe39be2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%global debug_package %{nil}
%global crate_name ripgrep

Name:		rust-ripgrep
Version:	14.1.0
Release:	1
Summary:	Line-oriented search tool
License:	Unlicense OR MIT
URL:		https://crates.io/crates/cbindgen
Source0:	https://github.com/BurntSushi/ripgrep/archive/refs/tags/%{version}.tar.gz
Source1:	vendor.tar.xz
Source2:	cargo_config

%global _description %{expand:
Ripgrep is a line-oriented search tool that recursively searches the
current directory for a regex pattern while respecting gitignore rules.
ripgrep has first class support on Windows, macOS and Linux.}

%description %{_description}

%prep
%setup -q -T -b 0 -n %{crate_name}-%{version}
%setup -q -D -T -a 1 -n %{crate_name}-%{version}
cp %{SOURCE2} .cargo/config.toml

%build
cargo build --release

%install
export CARGO_HOME=`pwd`/cargo-home/
# cargo install appends /bin to the path
cargo install --root=%{buildroot}%{_prefix} --path .
# remove spurious files
rm -f %{buildroot}%{_prefix}/.crates.toml
rm -f %{buildroot}%{_prefix}/.crates2.json

%files
%license UNLICENSE
%{_bindir}/rg