]> git.pld-linux.org Git - SPECS.git/blob - the_silver_searcher.spec
SPECS updated Mon 29 Apr 22:05:02 CEST 2024
[SPECS.git] / the_silver_searcher.spec
1 Summary:        A code-searching tool similar to ack, but faster
2 Name:           the_silver_searcher
3 Version:        2.2.0
4 Release:        2
5 License:        Appache v2.0
6 Group:          Applications
7 Source0:        https://geoff.greer.fm/ag/releases/%{name}-%{version}.tar.gz
8 # Source0-md5:  958a614cbebf47b2f27a7d00a5bb1bcb
9 Patch0:         gcc10.patch
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)
20
21 %define         zshdir %{_datadir}/zsh/site-functions
22
23 %description
24 An attempt to make something better than ack (which itself is better
25 than grep).
26
27 Why use Ag?
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!
33
34 How is it so fast?
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
38   JIT compiler.
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
43   files in parallel.
44
45 %package -n bash-completion-%{name}
46 Summary:        bash-completion for the_silver_searcher
47 Group:          Applications/Shells
48 Requires:       bash-completion
49 BuildArch:      noarch
50
51 %description -n bash-completion-%{name}
52 This package provides bash-completion for the_silver_searcher.
53
54 %package -n zsh-completion-%{name}
55 Summary:        zsh-completion for the_silver_searcher
56 Group:          Applications/Shells
57 Requires:       zsh
58 BuildArch:      noarch
59
60 %description -n zsh-completion-%{name}
61 This package provides zsh-completion for the_silver_searcher.
62
63 %prep
64 %setup -q
65 %patch0 -p1
66 %patch1 -p1
67
68 %build
69 %{__aclocal} -I m4
70 %{__autoconf}
71 %{__autoheader}
72 %{__automake}
73 %configure \
74         --disable-silent-rules
75 %{__make}
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79 %{__make} install \
80         DESTDIR=$RPM_BUILD_ROOT
81
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
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %files
90 %defattr(644,root,root,755)
91 %doc README.md
92 %attr(755,root,root) %{_bindir}/ag
93 %{_mandir}/man1/ag.1*
94
95 %files -n bash-completion-%{name}
96 %defattr(644,root,root,755)
97 /etc/bash_completion.d/*
98
99 %files -n zsh-completion-%{name}
100 %defattr(644,root,root,755)
101 %{zshdir}/_the_silver_searcher
This page took 0.342837 seconds and 3 git commands to generate.