%define pkg_name    the_silver_searcher
%define pkg_version 0.32.0
%define pkg_release 1%{?_dist_release}

Summary:     ag: The silver searcher
Summary(ja): ag: 高速検索プログラム
Name:        silversearcher-ag
Version:     %{pkg_version}
Release:     %{pkg_release}
License:     Apache License 2.0

Group:  Applications/Accessories
URL:    https://github.com/ggreer/the_silver_searcher
Source: %{pkg_name}-%{pkg_version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: pcre-devel xz-devel zlib-devel
Requires: pcre xz zlib

Vendor: Project Vine
Distribution: Vine Linux
Packager: ara_t


%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–5x 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 .agignore 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.

%description -l ja
The Silver Searcher: 高速検索プログラム
* ackより3-5倍高速
* .gitignore、.hgignoreに記載されているものを検索対象から除外
* 検索対象から除外したいファイルは.agignoreに記載
* agというコマンド名で、ackと比べてコマンドが短い(33%減!)


%prep
%{__rm} -rf ${RPM_BUILD_ROOT}
%setup -q -n %{pkg_name}-%{pkg_version}

./build.sh
%{configure}

%build
%{__make} %{?_smp_mflags}

%install
%{make_install}

%clean
%{__rm} -rf ${RPM_BUILD_ROOT}


%files
%defattr(-, root, root)
%{_bindir}/
%{_datadir}/


%changelog
* Tue May 17 2016 Toshiaki Ara <ara_t@384.jp> 0.32.0-1
- update to 0.32.0

* Sun Apr 10 2016 Toshiaki Ara <ara_t@384.jp> 0.31.0-3
- correct SPEC file

* Wed Feb 17 2016 Toshiaki Ara <ara_t@384.jp> 0.31.0-2
- add LICENSE

* Tue Sep 22 2015 Toshiaki Ara <ara_t@384.jp> 0.31.0-1
- new package

