the_silver_searcher/the_silver_searcher.spec
2021-08-07 14:57:55 +08:00

71 lines
1.8 KiB
RPMSpec

%global commit 1a5e259b259130b50607174fc9f9508dc1f2941c
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global bashcompdir %(pkg-config --variable=completionsdir bash-completion)
%if "%{bashcompdir}" == ""
%define bashcompdir "/etc/bash_completion.d"
%endif
Name: the_silver_searcher
Version: 2.1.0
Release: 3
Summary: Super-fast text searching tool (ag)
Group: Applications/Text
License: ASL 2.0 and BSD
URL: https://github.com/ggreer/the_silver_searcher
Source: https://github.com/ggreer/the_silver_searcher/archive/%{commit}/%{version}-%{shortcommit}.tar.gz
Patch1: fix-build-error-gcc10.patch
BuildRequires: autoconf gcc
BuildRequires: automake
BuildRequires: pcre-devel
%if ! 0%{?el6}
BuildRequires: pkgconfig(bash-completion)
%endif
BuildRequires: xz-devel
BuildRequires: zlib-devel
%description
The Silver Searcher is a code searching tool similar to ack,
with a focus on speed.
%prep
%setup -q -n %{name}-%{commit}
%patch1 -p1
%build
aclocal
autoconf
autoheader
automake --add-missing
%configure --disable-silent-rules
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{bashcompdir}
install -pm 0644 ag.bashcomp.sh $RPM_BUILD_ROOT%{bashcompdir}/ag
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}
%files
%{_bindir}/ag
%{_mandir}/man1/ag.1*
%(dirname %{bashcompdir})
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%doc README.md
%license LICENSE
%else
%doc README.md LICENSE
%endif
# zsh completion
%{_datadir}/zsh/site-functions/_%{name}
%changelog
* Sat 7 Aug 2021 zhangtao <zhangtao221@huawei.com> - 2.1.0-3
- fix gcc upgrade causes compilation failure
* Tue 27 Jul 2021 sunguoshuai <sunguoshuai@huawei.com> - 2.1.0-2
- Add gcc for buildrequires
* Wed Sep 16 2020 Li Chao <clouds@isrc.iscas.ac.cn> - 2.1.0-1
- First the_silver_searcher package