%define real_name Thread-Pool

Summary:        Group of threads for performing similar jobs
Name:           perl-Thread-Pool
Version:        0.33
Release:        1%{?_dist_release}
License:        Artistic
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/Thread-Pool/

Source:         http://www.cpan.org/modules/by-module/Thread/Thread-Pool-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

BuildArch:      noarch
BuildRequires:  perl
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(load)
BuildRequires:  perl(Thread::Conveyor) >= 0.15
BuildRequires:  perl(Thread::Conveyor::Monitored) >= 0.11
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))

Vendor:         Project Vine
Distribution:   Vine Linux

%description
The Thread::Pool allows you to set up a group of (worker) threads to
execute a (large) number of similar jobs that need to be executed
asynchronously. The routine that actually performs the job (the "do"
routine), must be specified as a name or a reference to a (anonymous)
subroutine.

This module only functions on Perl versions 5.8.0 and later.
And then only when threads are enabled with -Dusethreads.  It
is of no use with any version of Perl before 5.8.0 or without
threads enabled.
%prep
%setup -q -n %{real_name}-%{version}

%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null
%{_fixperms} %{buildroot}

%check
make test

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

%files
%defattr(-, root, root, 0755)
%doc MANIFEST README CHANGELOG TODO
%{perl_vendorlib}/*
%{_mandir}/man3/*

%changelog
* Sat Mar 10 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.33-1
- initial build for Vine Linux
