Summary: the DBI PostgreSQL interface for Perl
Name: perl-DBD-Pg
Version: 2.18.0
Release: 2%{?_dist_release}
License: GPL or Artistic
Group: Development/Libraries
Source0: http://search.cpan.org/CPAN/authors/id/D/DB/DBDPG/DBD-Pg-%{version}.tar.gz
Source1: filter-requires-perl-DBD-Pg.sh
Patch0:perl-DBD-1.31-fixver.patch

Url: http://search.cpan.org/author/DWHEELER/DBD-Pg/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: perl >= 5.004, postgresql-devel, perl-DBI
Requires: perl >= 5.004

%define __perl_requires %{SOURCE1}

Vendor: Project Vine
Distribution: Vine Linux

%description
the DBI PostgreSQL interface for Perl

%prep
%setup -q -n DBD-Pg-%{version} 

%patch0 -p1 -b .fixver

%build
export POSTGRES_INCLUDE=%{_includedir}/pgsql
export POSTGRES_LIB=%{_libdir}
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLDIRS=vendor
make

%check
make test

%clean 
rm -rf %{buildroot}

%install
rm -rf %{buildroot}
#mkdir -p %{buildroot}%{_prefix}
#make INSTALLSITEARCH=%{buildroot}%{perl_sitearch} \
#     INSTALLSITEMAN3DIR=%{buildroot}%{_mandir}/man3  \
#     install

make DESTDIR=$RPM_BUILD_ROOT install

find %{buildroot}%{_prefix} -type f -print | 
	sed "s@^%{buildroot}@@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

%files -f %{name}.files
%defattr(-,root,root)
%doc README Changes
%dir %{perl_vendorarch}/DBD
%dir %{perl_vendorarch}/auto/DBD
%dir %{perl_vendorarch}/auto/DBD/Pg
%{_mandir}/*/*

%changelog
* Tue Apr 12 2011 Shu KONNO <owa@bg.wakwak.com> 2.18.0-2
- rebuilt with postgresql-9.0.3

* Wed Mar 30 2011 IWAI, Masaharu <iwai@alib.jp> 2.18.0-1
- new upstream release
- drop  CVE-2009-0663, 1341 patch (Patch1): upstream fixed
- add requires filter (Source1)
- add Vendor and Distribution tags

* Wed Jul 08 2009 Shu KONNO <owa@bg.wakwak.com> 1.49-5
- rebuilt with postgresql-8.4.0

* Sat May 16 2009 Satoshi IWMAOTO <satoshi.iwamoto@nifty.ne.jp> 1.49-4vl5
- add patch0 from rhel5 
- add patch1 to fix CVE-2009-0663, 1341
- 2vl5,3vl5 are skipped to Plus < Seed version number...

* Sat Jul 05 2008 Shu KONNO <owa@bg.wakwak.com> 1.49-1vl5
- applied new versioning policy
- rebuilt with postgresql-8.3.3

* Tue Jan 08 2008 Shu KONNO <owa@bg.wakwak.com> 1.49-0vl5
- rebuilt with postgresql-8.2.6

* Wed Sep 19 2007 Shu KONNO <owa@bg.wakwak.com> 1.49-0vl4
- rebuilt with postgresql-8.2.5

* Sun Sep 10 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.49-0vl1
- new upstream release
- rebuilt with perl-5.8.6, perl-DBI-1.51
- changed Group to Development/Libraries
- installed files to vendor_perl

* Mon Jan 10 2005 Satoshi MACHINO <machino@vinelinux.org> 1.22-0vl3
- rebuilt for VineSeed
	-- built with perl-5.8.6, perl-DBI-1.46

* Mon Jan 10 2005 Satoshi MACHINO <machino@vinelinux.org> 1.22-0vl2
- rebuilt for VineLinux-3.1
	-- built with perl-5.8.2, perl-DBI-1.46

* Sat May 24 2003 IWAI Masaharu <iwai@alib.jp> 1.22-0vl1
- first build for Vine Linux

