%define real_name Log-Dispatch-Config

Summary:        Perl module that implements Log4j
Name:           perl-%{real_name}
Version:        1.03
Release:        1%{?_dist_release}
License:        GPL+ or Artistic
Group:          Development/Libraries
Source0:        http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/%{real_name}-%{version}.tar.gz
URL:            http://search.cpan.org/dist/Log-Dispatch-Config/
BuildArch:      noarch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

BuildRequires:  perl(AppConfig) >= 1.52
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(File::Temp) >= 0.12
BuildRequires:  perl(IO::Scalar)
BuildRequires:  perl(Log::Dispatch) >= 2
BuildRequires:  perl(Test::More) >= 0.32
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires:       perl(AppConfig) >= 1.52
Requires:       perl(File::Temp) >= 0.12
Requires:       perl(IO::Scalar)
Requires:       perl(Log::Dispatch) >= 2
Requires:       perl(Test::More) >= 0.32

Vendor:         Project Vine
Distribution:   Vine Linux
Packager:       shaolin

%description
Log-Dispatch-Config is a Perl module that implements Log4j.

%prep
%setup -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}

%clean 
rm -rf %{buildroot}

%check
make test

%files
%defattr(-, root, root, 0755)
%doc Changes MANIFEST META.yml README
%doc %{_mandir}/man3/Log::Dispatch::Config.3pm*
%doc %{_mandir}/man3/Log::Dispatch::Configurator.3pm*
%doc %{_mandir}/man3/Log::Dispatch::Configurator::AppConfig.3pm*
%dir %{perl_vendorlib}/Log/
%dir %{perl_vendorlib}/Log/Dispatch/
%{perl_vendorlib}/Log/Dispatch/Config.pm
%{perl_vendorlib}/Log/Dispatch/Configurator.pm
%dir %{perl_vendorlib}/Log/Dispatch/Configurator/
%{perl_vendorlib}/Log/Dispatch/Configurator/AppConfig.pm

%changelog
* Fri Mar 09 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.03-1
- initial build for Vine Linux
