%define pkgname Test-MockDBI

Name:       perl-%{pkgname}
Version:    0.65
Release:    3%{?_dist_release}
Summary:    Test by mocking-up DBI 

License:    Artistic or GPL+
Group:      Development/Libraries
URL:        http://search.cpan.org/dist/%{pkgname}
Source0:    http://search.cpan.org/CPAN/authors/id/A/AF/AFF/%{pkgname}-%{version}.tar.gz
BuildRequires:  perl
BuildRequires:  perl(DBI)
BuildRequires:  perl(Test::MockObject)
Requires:       perl(DBI)
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

Vendor:         Project Vine
Distribution:   Vine Linux
Packager:       shaolin

%description
Test::MockDBI provides a way to test DBI interfaces by creating rules for
changing the DBI\'s behavior, then examining the standard output for
matching patterns. 

%prep
%setup -q -n %{pkgname}-%{version}
find . -type f -print0 | xargs -0 chmod 644
%{__cat} > DBI.cfg << EOF
DSN  DBI:SQLite:dbname=test
USER test
PASS 
SQL  SELECT 1
EOF


%build
%{__perl} Makefile.PL installdirs=vendor
%{__make} %{?_smp_mflags}

%check
%{__make} test

%install
rm -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}

%{__rm} -rf %{buildroot}%{perl_archlib}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,755)
%doc Changes HISTORY README TODO
%{_mandir}/man3/*
%{perl_vendorlib}/*



%changelog
* Sat Oct 11 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 0.65-3
- rebuild with perl 5.16.3
- moved to Development/Libraries Group

* Thu Mar 01 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.65-2
- rebuild

* Mon Feb 20 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.65-1
- initial build for Vine Linux

* Fri Sep 30 2011 Leonardo Coelho <leonardoc@mandriva.com> 0.650.0-1mdv2012.0
+ Revision: 702167
- first mandriva version
- Created package structure for 'perl-Test-MockDBI'.

