forked from ggreer/the_silver_searcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
the_silver_searcher.spec.in
75 lines (58 loc) · 2.26 KB
/
the_silver_searcher.spec.in
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
%define _bashcompdir %_sysconfdir/bash_completion.d
%define _zshcompdir %{_datadir}/zsh/site-functions
Name: the_silver_searcher
Version: @VERSION@
Release: 1%{?dist}
Summary: A code-searching tool similar to ack, but faster
Group: Applications/Utilities
License: Apache v2.0
URL: https://github.com/ggreer/%{name}
Source0: https://github.com/downloads/ggreer/%{name}/%{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: pcre-devel, xz-devel, zlib-devel
Requires: pcre, xz, zlib
%description
The Silver Searcher
An attempt to make something better than ack (which itself is better than grep).
Why use Ag?
* It searches code about 3–5× faster than ack.
* It ignores file patterns from your .gitignore and .hgignore.
* If there are files in your source repo you don't want to search, just add their patterns to a .ignore file. *cough* extern *cough*
* The command name is 33% shorter than ack!
How is it so fast?
* Searching for literals (no regex) uses Boyer-Moore-Horspool strstr.
* Files are mmap()ed instead of read into a buffer.
* If you're building with PCRE 8.21 or greater, regex searches use the JIT compiler.
* Ag calls pcre_study() before executing the regex on a jillion files.
* Instead of calling fnmatch() on every pattern in your ignore files, non-regex patterns are loaded into an array and binary searched.
* Ag uses Pthreads to take advantage of multiple CPU cores and search files in parallel.
%prep
%setup -q
%build
aclocal
autoconf
autoheader
automake --add-missing
%configure
make %{?_smp_mflags}
%install
rm -rf ${RPM_BUILD_ROOT}
make install DESTDIR=${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_bashcompdir}
install -m 644 ag.bashcomp.sh ${RPM_BUILD_ROOT}%{_bashcompdir}
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_mandir}/*
%config %{_bashcompdir}/ag.bashcomp.sh
%config %{_datadir}/%{name}/completions/ag.bashcomp.sh
%config %{_datadir}/zsh/site-functions/_the_silver_searcher
%changelog
* Thu Dec 5 2013 Emily Strickland <code@emily.st> - 0.18.1-1
- More accurate build and install requirements
* Fri Aug 16 2013 Andrew Seidl <git@aas.io> - 0.15.0-1
- Install bash completion file
* Wed Dec 05 2012 Daniel Nelson <packetcollision@gmail.com> - 0.13.1-1
- Initial Build