Summary: Check validity of Internet email addresses for Perl
Name: perl-Email-Valid
Version: 1.194
Release: 1%{?_dist_release}
License: Artistic and GPL
Group: Development/Libraries
Source0: http://search.cpan.org/CPAN/authors/id/M/MA/MAURICE/Email-Valid-%{version}.tar.gz
# based http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/*checkout*/perldocjp/docs/modules/Email-Valid-0.184/lib/Email/Valid.pod?rev=1.1
Source1: Email-Valid-0.184.pod.ja
URL: http://search.cpan.org/author/MAURICE/Email-Valid/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: perl >= 5.6
BuildRequires: perl(Test::More)
BuildRequires: perl(Mail::Address)
BuildRequires: perl(Scalar::Util)
BuildRequires: perl(Net::DNS)
# for nslookup(1) in %%check
BuildRequires: bind-utils
Requires: perl >= 5.6
BuildArch: noarch

Vendor: Project Vine
Distribution: Vine Linux

%description
This module determines whether an email address is well-formed, and
optionally, whether a mail host exists for the domain.

%prep
%setup -q -n Email-Valid-%{version} 

%build
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLDIRS=vendor
make
cp %{SOURCE1} Valid.ja.pm

%clean 
rm -rf $RPM_BUILD_ROOT

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p %{buildroot}%{_mandir}/ja/man3
pod2man --section=3 Valid.ja.pm %{buildroot}%{_mandir}/ja/man3/Email::Valid.3pm

find $RPM_BUILD_ROOT%{_prefix} -type f -print | 
	sed "s@^$RPM_BUILD_ROOT@@g" | 
	grep -v ^%{_mandir} | 
	grep -v perllocal.pod | 
	grep -v "\.packlist" > %{name}.files
if [ "$(cat %{name}.files)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi

%check
make test

%files -f %{name}.files
%defattr(-,root,root)
%doc Changes README
%{_mandir}/man3/*
%{_mandir}/ja/man3/*
%dir %{perl_vendorlib}/Email

%changelog
* Mon Jun 30 2014 IWAI, Masaharu <iwaim.sub@gmail.com> 1.194-1
- build with Perl 5.16
- update to 0.194
- update BuildRequires and Requires

* Wed Mar 30 2011 IWAI, Masaharu <iwai@alib.jp> 0.184-1
- new upstream release
- update Japanese pod file (Source1)
- add BuildRequires(check): bind-utils
- add Vendor and Distribution tags

* Sat Feb 14 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.180-1
- new upstream release
- built with perl-5.10.0
- installed files to vendor_perl dir
- applied new versioning policy
- changed Group to Development/Libraries

* Sat Dec  4 2004 IWAI, Masaharu <iwai@alib.jp> 0.15-0vl2
- build on perl-5.8.6-0vl1
- add manpage translated into Japanese ( Source1 ) from perldoc.jp

* Mon Aug 16 2004 IWAI, Masaharu <iwai@alib.jp> 0.15-0vl1
- new upstream release

* Thu Apr 24 2003 IWAI Masaharu <iwai@alib.jp> 0.14-0vl2
- build with perl-5.8.0
- add test in %%build section
- add perl-MailTools in BuildRequires

* Sun Aug 25 2002 IWAI Masaharu <iwai@alib.jp> 0.14-0vl1
- first build for Vine Linux
