Blob Blame History Raw
Summary:	Search mailboxes for a particular email
Name:		grepmail
Version:	5.3032
Release:	5%{?dist}
License:	GPL
Group:		Applications/Text
Url:		http://grepmail.sourceforge.net/
Source0:	http://dl.sf.net/grepmail/grepmail-%{version}.tar.gz
Patch0:		grepmail-5.3032-CPAN24341.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:	noarch
Requires:	perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires:	perl(Mail::Mbox::MessageParser) >= 1.4001
BuildRequires:	perl(Mail::Mbox::MessageParser) >= 1.4001, perl(Date::Parse), perl(Date::Manip)
# The following module requirements are optional and hence not picked up by RPM automatically.
# Adding manual deps for them improves grepmail's functionality.
Requires:	perl(Date::Parse), perl(Date::Manip)
# perl(Date::Parse) can be found in the perl-TimeDate package

%description
Grepmail searches a normal or compressed mailbox for a given regular
expression, and returns those emails that match it. Piped input is allowed,
and date and size restrictions are supported, as are searches using logical
operators.

%prep
%setup -q -n %{name}-%{version}

# Fix for CPAN RT#24341 (test suite failures with recent Mail::Mbox::MessageParser)
%patch0 -p1 -b .CPAN24341

# Permissions wrong in tarball
%{__chmod} -x CHANGES LICENSE README

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor --default
%{__make} %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}
%{__make} pure_install PERL_INSTALL_ROOT=%{buildroot}
/usr/bin/find %{buildroot} -type f -name .packlist -exec %{__rm} -f {} ';'
/usr/bin/find %{buildroot} -depth -type d -exec /bin/rmdir {} 2>/dev/null ';'
%{__chmod} -R u+w %{buildroot}/*

%check
export LANG=C
export TZ=GMT0
%{__make} test

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc README* CHANGES LICENSE
%{_bindir}/grepmail
%{_mandir}/man1/grepmail.1*

%changelog
* Tue Feb 27 2007 Paul Howarth <paul@city-fan.org> 5.3032-5
- Add patch to fix CPAN RT#24341 (test suite failures with recent
  Mail::Mbox::MessageParser)
- Fix argument order for find with -depth

* Tue Aug 29 2006 Paul Howarth <paul@city-fan.org> 5.3032-4
- FE6 rebuild

* Thu Feb 16 2006 Paul Howarth <paul@city-fan.org> 5.3032-3
- Don't use macros in command paths, hardcode them instead

* Wed Oct 12 2005 Paul Howarth <paul@city-fan.org> 5.3032-2
- Remove spec file comments about package naming (#170506)

* Wed Oct 12 2005 Paul Howarth <paul@city-fan.org> 5.3032-1
- Fedora Extras submission