File grep.spec of Package grep

# spec file for package grep (Version 2.7)
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           grep
BuildRequires:  pcre-devel
%if 0%{?suse_version} < 1120
BuildRequires:  pcre
License:        GPLv3
Group:          Productivity/Text/Utilities
Provides:       base:/usr/bin/grep
AutoReqProv:    on
PreReq:         %{install_info_prereq}
Version:        2.7
Release:        2
Summary:        Print lines matching a pattern
Source:         grep-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

The grep command searches one or more input files
for lines containing a match to a specified pattern.
By default, grep prints the matching lines.

%setup -q
%if 0%{?suse_version} < 1120
echo "ac_cv_search_pcre_compile=\${ac_cv_search_pcre_compile=%{_libdir}/libpcre.a}" >config.cache

%if 0%{?suse_version} < 1120
%configure -C --bindir=/bin --without-included-regex
AUTOPOINT=true autoreconf --force --install
%configure --bindir=/bin --without-included-regex
%{__make} %{?_smp_mflags}

make check VERBOSE=1

install -d $RPM_BUILD_ROOT/usr/bin
ln -sf ../../bin/egrep $RPM_BUILD_ROOT/usr/bin/egrep
ln -sf ../../bin/fgrep $RPM_BUILD_ROOT/usr/bin/fgrep
ln -sf ../../bin/grep  $RPM_BUILD_ROOT/usr/bin/grep
%find_lang %name

%install_info --info-dir=%{_infodir} %{_infodir}/

%install_info_delete --info-dir=%{_infodir} %{_infodir}/

%files -f %name.lang
%doc %{_mandir}/man1/*.gz
%doc %{_infodir}/*.gz