Summary: a libpq-based PostgreSQL interface for Perl
Name: pgperl
Version: 2.0.2
Release: 2%{?_dist_release}
URL: http://gborg.postgresql.org/project/pgperl/projdisplay.php
Source0: ftp://gborg.postgresql.org/pub/pgperl/stable/%{name}-%{version}.tar.gz
License: Perl's
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-root
Requires: postgresql-libs
BuildRequires: postgresql-devel perl
Obsoletes: postgresql-perl

%description
pgperl is an interface between Perl and PostgreSQL. This uses the Perl5
API for C extensions to call the PostgreSQL libpq interface. Unlike
DBD:pg, pgperl tries to implement the libpq interface as closely as
possible.

You have a choice between two different interfaces: the old C-style
interface and a new one, using a more Perl-ish style. The old style has
the benefit that existing libpq applications can easily be ported to 
perl. The new style uses class packages and might be more familiar to
C++ programmers. 

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

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

%install
rm -rf %{buildroot}
make DESTDIR=$RPM_BUILD_ROOT install
#make PREFIX=%{buildroot}%{_prefix} \
#     INSTALLSITEARCH=%{buildroot}%{perl_sitearch} \
#     INSTALLSITEMAN3DIR=%{buildroot}%{_mandir}/man3 install

find $RPM_BUILD_ROOT%{_prefix} -type f -print | 
        sed "s@^$RPM_BUILD_ROOT@@g" | 
        grep -v perllocal.pod       |
        grep -v "\.packlist"        |
        grep -v ^%{_mandir}         > %{name}.files 
if [ "$(cat %{name}.files)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi

%clean
rm -rf %{buildroot}

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

%changelog
* Wed Jul 08 2009 Shu KONNO <owa@bg.wakwak.com> 2.0.2-2
- rebuilt with postgresql-8.4.0

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

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

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

* Tue Sep 12 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.2-0vl3
- changed Group to Development/Libraries

* Sat Mar 18 2006 Shu KONNO <owa@bg.wakwak.com> 2.0.2-0vl2
- rebuilt with postgresql-8.0.x

* Sat Apr 26 2003 IWAI Masaharu <iwai@alib.jp> 2.0.2-0vl1
- first build for Vine Linux