1 Summary: A code-searching tool similar to ack, but faster
2 Name: the_silver_searcher
7 Source0: https://geoff.greer.fm/ag/releases/%{name}-%{version}.tar.gz
8 # Source0-md5: 958a614cbebf47b2f27a7d00a5bb1bcb
10 Patch1: hl_multi_matches_nomultiline.patch
11 URL: https://geoff.greer.fm/ag/
12 BuildRequires: autoconf >= 2.59
13 BuildRequires: automake
14 BuildRequires: pcre-devel
15 BuildRequires: pkgconfig
16 BuildRequires: xz-devel
17 BuildRequires: zlib-devel
18 Suggests: bash-completion-%{name}
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 %define zshdir %{_datadir}/zsh/site-functions
24 An attempt to make something better than ack (which itself is better
28 - It searches code about 3–5× faster than ack.
29 - It ignores file patterns from your .gitignore and .hgignore.
30 - If there are files in your source repo you don't want to search,
31 just add their patterns to a .ignore file. *cough* extern *cough*
32 - The command name is 33% shorter than ack!
35 - Searching for literals (no regex) uses Boyer-Moore-Horspool strstr.
36 - Files are mmap()ed instead of read into a buffer.
37 - If you're building with PCRE 8.21 or greater, regex searches use the
39 - Ag calls pcre_study() before executing the regex on a jillion files.
40 - Instead of calling fnmatch() on every pattern in your ignore files,
41 non-regex patterns are loaded into an array and binary searched.
42 - Ag uses Pthreads to take advantage of multiple CPU cores and search
45 %package -n bash-completion-%{name}
46 Summary: bash-completion for the_silver_searcher
47 Group: Applications/Shells
48 Requires: bash-completion
51 %description -n bash-completion-%{name}
52 This package provides bash-completion for the_silver_searcher.
54 %package -n zsh-completion-%{name}
55 Summary: zsh-completion for the_silver_searcher
56 Group: Applications/Shells
60 %description -n zsh-completion-%{name}
61 This package provides zsh-completion for the_silver_searcher.
74 --disable-silent-rules
78 rm -rf $RPM_BUILD_ROOT
80 DESTDIR=$RPM_BUILD_ROOT
82 install -d $RPM_BUILD_ROOT/etc/bash_completion.d
83 rm $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/ag.bashcomp.sh
84 cp -p ag.bashcomp.sh $RPM_BUILD_ROOT/etc/bash_completion.d
87 rm -rf $RPM_BUILD_ROOT
90 %defattr(644,root,root,755)
92 %attr(755,root,root) %{_bindir}/ag
95 %files -n bash-completion-%{name}
96 %defattr(644,root,root,755)
97 /etc/bash_completion.d/*
99 %files -n zsh-completion-%{name}
100 %defattr(644,root,root,755)
101 %{zshdir}/_the_silver_searcher