%define real_name Authen-Captcha

Summary: a Perl extension for creating captchas
Summary(ja): CAPTCHA(tm) を Perl で扱うための Module
Name: perl-Authen-Captcha
Version: 1.024
Release: 1%{?_dist_release}
License: distributable
Group: Development/Libraries
URL: http://search.cpan.org/~lkundrak/Authen-Captcha/

Source0: http://search.cpan.org/CPAN/authors/id/L/LK/LKUNDRAK/%{real_name}-%{version}.tar.gz

Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
BuildRequires: perl >= 5.8.0
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(GD)
BuildRequires: perl(String::Random)
Requires:      perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description
Perl extension for creating captcha's
to verify the human element in transactions.

%description -l ja
CAPTCHA(tm) を Perl で扱うための Module

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

%build
perl Makefile.PL INSTALLDIRS=vendor
make

%install
rm -rf %{buildroot}
make pure_install DESTDIR=%{buildroot}
             
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

%clean 
rm -rf %{buildroot}

%check
make test

%files -f %{name}.files
%defattr(-,root,root)
%doc Changes MANIFEST README license.txt
%dir %{perl_vendorlib}/Authen/Captcha
%{_mandir}/*/*

%changelog
* Fri Dec 19 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.024-1
- updated to 1.024
- added BR: perl(String::Random)

* Sat Apr 30 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.023-2
- rebuild with perl-5.12.3

* Wed Mar 11 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.023-1
- applied new versioning policy
- spec in UTF-8
- changed Group to Development/Libraries
- installed perl modules to vendor_perl directory

* Wed Jul 26 2006 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 1.023-0vl1
- for VineSeed (plus)

* Tue Jul 11 2006 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 1.023-0vl0
- initial package for VinePlus
