#
# Conditional build:
-%bcond_with pcre # with PCRE support
+%bcond_without pcre # PCRE support
+%bcond_without tests # don't perform "make check"
#
Summary: GNU grep Utilities
-Summary(de.UTF-8): GNU-Version der Pattern-Matching-Utilities
-Summary(es.UTF-8): Utilitarios grep GNU
-Summary(fr.UTF-8): Utilitaires grep de GNU
-Summary(ja.UTF-8): GNU grep の日本語対応版です.
-Summary(pl.UTF-8): GNU grep
-Summary(pt_BR.UTF-8): Utilitários grep GNU
-Summary(ru.UTF-8): Утилиты поиска по шаблонам GNU grep
-Summary(tr.UTF-8): Dosyalarda katar arama aracı
-Summary(uk.UTF-8): Утиліти пошуку по шаблонам GNU grep
+Summary(de.UTF-8): GNU-Version der Pattern-Matching-Utilities
+Summary(es.UTF-8): Utilitarios grep GNU
+Summary(fr.UTF-8): Utilitaires grep de GNU
+Summary(ja.UTF-8): GNU grep の日本語対応版です.
+Summary(pl.UTF-8): GNU grep
+Summary(pt_BR.UTF-8): Utilitários grep GNU
+Summary(ru.UTF-8): Утилиты поиска по шаблонам GNU grep
+Summary(tr.UTF-8): Dosyalarda katar arama aracı
+Summary(uk.UTF-8): Утиліти пошуку по шаблонам GNU grep
Name: grep
-Version: 2.5.1a
-Release: 2
+Version: 2.11
+Release: 1
Epoch: 2
-License: GPL
+License: GPL v3+
Group: Applications/Text
-Source0: ftp://ftp.gnu.org/gnu/grep/%{name}-%{version}.tar.gz
-# Source0-md5: 71db1cb262c27f02461c4bca514591ce
+Source0: http://ftp.gnu.org/gnu/grep/%{name}-%{version}.tar.xz
+# Source0-md5: ad9c6dbdeab93e50d2bc380f10ed3643
Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
# Source1-md5: 1b5e726d0bee53e898531de4a76ad290
Patch0: %{name}-info.patch
-Patch1: %{name}-egrep.patch
-Patch2: %{name}-locale-names.patch
+Patch1: %{name}-pl.po-update.patch
URL: http://www.gnu.org/software/grep/grep.html
-BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: gettext-devel
-BuildRequires: libtool
+BuildRequires: autoconf >= 2.59
+BuildRequires: automake >= 1:1.11
+BuildRequires: gettext-devel >= 0.18
%{?with_pcre:BuildRequires: pcre-devel}
+BuildRequires: tar >= 1:1.22
BuildRequires: texinfo
-%{?with_pcre:Requires: pcre}
+BuildRequires: xz
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _bindir /bin
%setup -q
%patch0 -p1
%patch1 -p1
-%patch2 -p1
-rm -f m4/{header,init}.m4
-
-# hack: AC_FUNC_STRERROR_R from strerror_r.m4 must override autoconf's version
-# (it contains HAVE_WORKING_STRERROR_R define, needed with glibc 2.x, as
-# glibc version returns pointer to string and doesn't seem to store string in
-# supplied buffer(???))
-cat m4/strerror_r.m4 >> acinclude.m4
-touch m4/{header,init}.m4
-
-# there is nb.po included, but more outdated than no.po (only no was in LINGUAS)
-mv -f po/{no,nb}.po
+%{__rm} po/stamp-po
%build
-%{__libtoolize}
+%{__gettextize}
%{__aclocal} -I m4
-%{__automake}
%{__autoconf}
-%ifarch sparc sparc64
-CPPFLAGS=""
-export CPPFLAGS
-%endif
+%{__autoheader}
+%{__automake}
%configure \
%{!?with_pcre:--disable-perl-regexp} \
- --without-included-regex \
- --enable-nls
+ --disable-silent-rules \
+ --without-included-regex
%{__make}
+%{?with_tests:%{__make} check}
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/etc/env.d
%find_lang %{name}
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
-rm -f $RPM_BUILD_ROOT%{_mandir}/README.grep-non-english-man-pages
-rm -f $RPM_BUILD_ROOT%{_mandir}/ja-grep-nozgrep.diff
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/README.grep-non-english-man-pages
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/ja-grep-nozgrep.diff
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(644,root,root,755)
%doc NEWS README ChangeLog TODO
-%config(noreplace,missingok) %verify(not md5 mtime size) /etc/env.d/*
-%attr(755,root,root) %{_bindir}/*
-%{_mandir}/man1/*
+%config(noreplace,missingok) %verify(not md5 mtime size) /etc/env.d/GREP_OPTIONS
+%attr(755,root,root) %{_bindir}/egrep
+%attr(755,root,root) %{_bindir}/fgrep
+%attr(755,root,root) %{_bindir}/grep
+%{_mandir}/man1/egrep.1*
+%{_mandir}/man1/fgrep.1*
+%{_mandir}/man1/grep.1*
%lang(cs) %{_mandir}/cs/man1/*
%lang(de) %{_mandir}/de/man1/*
%lang(es) %{_mandir}/es/man1/*
%lang(ja) %{_mandir}/ja/man1/*
%lang(nl) %{_mandir}/nl/man1/*
%lang(pl) %{_mandir}/pl/man1/*
-%{_infodir}/*info*
+%{_infodir}/grep.info*