grep/grep.spec
2024-02-07 23:12:20 +08:00

91 lines
2.3 KiB
RPMSpec

#
# spec file for package grep
#
# Copyright (c) 2022-2023 ZhuningOS
#
Name: grep
Version: 3.1
Release: 150000.4.6.1
Summary: Print lines matching a pattern
License: GPL-3.0+
Group: Productivity/Text/Utilities
Url: https://www.gnu.org/software/grep/
Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
Source2: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig
Source3: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=grep&download=1#/%{name}.keyring
Source4: profile.sh
Patch0: testsuite.patch
BuildRequires: fdupes
BuildRequires: makeinfo
BuildRequires: pcre-devel
Requires(pre): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
Recommends: %{name}-lang
Provides: base:%{_bindir}/grep
%description
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.
%lang_package
%prep
%setup -q
%patch0 -p1
%build
%configure \
--disable-silent-rules \
--without-included-regex
%if %{do_profiling}
make %{?_smp_mflags} CFLAGS="%{optflags} %{cflags_profile_generate}"
setarch `arch` -R sh %{SOURCE4} # profiling run
make clean
make %{?_smp_mflags} CFLAGS="%{optflags} %{cflags_profile_feedback}"
%else
make %{?_smp_mflags} CFLAGS="%{optflags}"
%endif
%check
make %{?_smp_mflags} check
%install
%make_install
#UsrMerge
install -d %{buildroot}/bin
ln -sf %{_bindir}/egrep %{buildroot}/bin/egrep
ln -sf %{_bindir}/fgrep %{buildroot}/bin/fgrep
ln -sf %{_bindir}/grep %{buildroot}/bin/grep
#EndUsrMerge
%fdupes -s %{buildroot}
%find_lang %{name}
%post
%install_info --info-dir=%{_infodir} %{_infodir}/grep.info%{ext_info}
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/grep.info%{ext_info}
%files
%defattr(-,root,root)
%license COPYING
%doc README AUTHORS NEWS THANKS TODO ChangeLog*
#UsrMerge
/bin/egrep
/bin/fgrep
/bin/grep
#EndUsrMerge
%{_bindir}/egrep
%{_bindir}/fgrep
%{_bindir}/grep
%{_mandir}/man1/egrep.1%{ext_man}
%{_mandir}/man1/fgrep.1%{ext_man}
%{_mandir}/man1/grep.1%{ext_man}
%{_infodir}/grep.info%{ext_info}
%files lang -f %{name}.lang
%defattr(-,root,root)
%changelog