]> git.pld-linux.org Git - packages/ripgrep.git/blob - ripgrep.spec
new
[packages/ripgrep.git] / ripgrep.spec
1 %define         crates_ver      12.1.1
2
3 Summary:        Line oriented search tool using Rust's regex library
4 Name:           ripgrep
5 Version:        12.1.1
6 Release:        1
7 License:        MIT or Unlicense
8 Group:          Applications
9 Source0:        https://github.com/BurntSushi/ripgrep/archive/%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5:  d3190853d47d51ad077a65aadbf55448
11 # ./create-crates.sh
12 Source1:        %{name}-crates-%{crates_ver}.tar.xz
13 # Source1-md5:  9edecedd92d2a028eff4d41fb3d8a800
14 URL:            https://github.com/BurntSushi/ripgrep
15 BuildRequires:  cargo
16 BuildRequires:  rpmbuild(macros) >= 2.004
17 BuildRequires:  rust
18 BuildRequires:  tar >= 1:1.22
19 BuildRequires:  xz
20 ExclusiveArch:  %{rust_arches}
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %description
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.
28
29 %prep
30 %setup -q -a1
31
32 %{__mv} %{name}-%{crates_ver}/* .
33 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
34
35 # use our offline registry
36 export CARGO_HOME="$(pwd)/.cargo"
37
38 mkdir -p "$CARGO_HOME"
39 cat >.cargo/config <<EOF
40 [source.crates-io]
41 registry = 'https://github.com/rust-lang/crates.io-index'
42 replace-with = 'vendored-sources'
43
44 [source.vendored-sources]
45 directory = '$PWD/vendor'
46 EOF
47
48 %build
49 export CARGO_HOME="$(pwd)/.cargo"
50
51 %cargo_build --frozen
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55 export CARGO_HOME="$(pwd)/.cargo"
56
57 %cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
58 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
59
60 %clean
61 rm -rf $RPM_BUILD_ROOT
62
63 %files
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
This page took 0.032464 seconds and 3 git commands to generate.