1 %define crates_ver 12.1.1
3 Summary: Line oriented search tool using Rust's regex library
7 License: MIT or Unlicense
9 Source0: https://github.com/BurntSushi/ripgrep/archive/%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5: d3190853d47d51ad077a65aadbf55448
12 Source1: %{name}-crates-%{crates_ver}.tar.xz
13 # Source1-md5: 9edecedd92d2a028eff4d41fb3d8a800
14 URL: https://github.com/BurntSushi/ripgrep
16 BuildRequires: rpmbuild(macros) >= 2.004
18 BuildRequires: tar >= 1:1.22
20 ExclusiveArch: %{rust_arches}
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 ripgrep is a line-oriented search tool that recursively searches your
25 current directory for a regex pattern. By default, ripgrep will
26 respect your .gitignore and automatically skip hidden
27 files/directories and binary files.
32 %{__mv} %{name}-%{crates_ver}/* .
33 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
35 # use our offline registry
36 export CARGO_HOME="$(pwd)/.cargo"
38 mkdir -p "$CARGO_HOME"
39 cat >.cargo/config <<EOF
41 registry = 'https://github.com/rust-lang/crates.io-index'
42 replace-with = 'vendored-sources'
44 [source.vendored-sources]
45 directory = '$PWD/vendor'
49 export CARGO_HOME="$(pwd)/.cargo"
54 rm -rf $RPM_BUILD_ROOT
55 export CARGO_HOME="$(pwd)/.cargo"
57 %cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
58 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
61 rm -rf $RPM_BUILD_ROOT
64 %defattr(644,root,root,755)
65 %doc CHANGELOG.md COPYING FAQ.md GUIDE.md LICENSE-MIT README.md UNLICENSE
66 %attr(755,root,root) %{_bindir}/rg