--- libpg-perl-2.1.1.orig/Pg.pm
+++ libpg-perl-2.1.1/Pg.pm
@@ -100,7 +100,7 @@
     $conn = Pg::connectdb("dbname=template1");
     $res  = $conn->exec("SELECT * from pg_user");
     while (@row = $res->fetchrow) {
-        print = join(" ", @row);
+        print join(" ", @row);
     }
 
 
--- libpg-perl-2.1.1.orig/debian/rules
+++ libpg-perl-2.1.1/debian/rules
@@ -0,0 +1,58 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+HERE=$(shell pwd)
+LIB=$(HERE)/debian/libpg-perl
+
+ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CONFFLAGS:= OPTIMIZE="-O3 -g"
+else
+	CONFFLAGS:= OPTIMIZE="-O0 -g"
+endif
+
+clean:
+	dh_testdir
+	dh_testroot
+	-$(MAKE) distclean
+	dh_clean
+	rm -f build-stamp
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	env POSTGRES_INCLUDE=`pg_config --includedir` POSTGRES_LIB=`pg_config --libdir` \
+		perl Makefile.PL PREFIX=/usr INSTALLDIRS=vendor $(CONFFLAGS)
+	$(MAKE)
+	touch build-stamp
+
+binary-arch: build-stamp
+	dh_testdir
+	dh_testroot
+
+	$(MAKE) DESTDIR=$(LIB) pure_vendor_install 
+	install -m 644 -D $(LIB)/usr/lib/perl5/Pg.pm $(LIB)/usr/share/perl5/Pg.pm
+
+	# install general Debian files
+	dh_installdocs -a README
+	dh_installchangelogs -a Changes
+
+	# install documentation
+	dh_installexamples -a examples/example* examples/ApachePg.pl
+
+	# build the packages
+	dh_strip -a
+	dh_compress -a
+	dh_fixperms -a
+	dh_shlibdeps -a
+	dh_makeshlibs -a
+	dh_perl -a
+	dh_installdeb -a
+	dh_gencontrol -a
+	dh_md5sums -a
+	dh_builddeb -a
+
+binary: binary-arch binary-indep
+
+.PHONY: build clean binary-indep binary-arch binary
--- libpg-perl-2.1.1.orig/debian/copyright
+++ libpg-perl-2.1.1/debian/copyright
@@ -0,0 +1,27 @@
+This package was debianized by Martin Pitt <mpitt@debian.org> on
+Thu, 15 Jan 2004 00:34:35 +0100.
+
+It was downloaded from:
+http://pgfoundry.org/projects/pgperl/
+
+Upstream Author: Edmund Mergl <E.Mergl@bawue.de>
+
+Copyright: (c) 1997, 1998  Edmund Mergl
+           (c) 1999-2002 PostgreSQL Global Development Group
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
--- libpg-perl-2.1.1.orig/debian/compat
+++ libpg-perl-2.1.1/debian/compat
@@ -0,0 +1 @@
+5
--- libpg-perl-2.1.1.orig/debian/control
+++ libpg-perl-2.1.1/debian/control
@@ -0,0 +1,19 @@
+Source: libpg-perl
+Priority: optional
+Section: perl
+Maintainer: Martin Pitt <mpitt@debian.org>
+Uploaders: Oliver Elphick <Oliver.Elphick@lfix.co.uk>
+Build-Depends: debhelper (>= 4.0.0), libpq-dev
+Standards-Version: 3.7.2
+
+Package: libpg-perl
+Architecture: any
+Depends: ${perl:Depends}, ${shlibs:Depends}
+Conflicts: postgresql-pl, libpgperl
+Replaces: postgresql (<< 7.3rel-5), postgresql-pl, libpgperl
+Description: Perl modules for PostgreSQL
+ This library enables Perl scripts to communicate with the PostgreSQL database
+ backend.
+ .
+ Perl is a widely used scripting language, which is always installed in Debian
+ systems.
--- libpg-perl-2.1.1.orig/debian/changelog
+++ libpg-perl-2.1.1/debian/changelog
@@ -0,0 +1,93 @@
+libpg-perl (1:2.1.1-4build3) trusty; urgency=low
+
+  * Rebuild for Perl 5.18.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 23 Oct 2013 11:47:02 +0100
+
+libpg-perl (1:2.1.1-4build2) precise; urgency=low
+
+  * Rebuild for Perl 5.14.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 16 Nov 2011 14:02:23 +0000
+
+libpg-perl (1:2.1.1-4build1) oneiric; urgency=low
+
+  * Rebuild for Perl 5.12.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 12 May 2011 09:31:38 +0100
+
+libpg-perl (1:2.1.1-4) unstable; urgency=high
+
+  * Urgency high since this fixes a grave bug.
+  * debian/rules: Robustify Pg.pm installation, to create /usr/share/perl5/
+    if it does not exist yet. The new perl apparently changed the behaviour of
+    pure_vendor_install. (Closes: #479382)
+  * debian/copyright: Update FSF address and upstream URL.
+  * Remove debian/watch, libpg-perl cannot currently be downloaded from
+    pgfoundry. Investigation is in progress. (see #453541)
+  * Bump Standards-Version to 3.7.2 and debhelper compat to 5.
+
+ -- Martin Pitt <mpitt@debian.org>  Wed, 07 May 2008 12:31:58 +0200
+
+libpg-perl (1:2.1.1-3) unstable; urgency=low
+
+  * Pg.pm: Fix stray '=' in POD synopsis. Closes: #395392
+  * Add watch file.
+
+ -- Martin Pitt <mpitt@debian.org>  Sun, 29 Oct 2006 16:59:32 +0100
+
+libpg-perl (1:2.1.1-2) unstable; urgency=low
+
+  * debian/rules: 
+    - Remove the install variables workaround again, it is not necessary any
+      more with the fixed Perl.
+    - Install upstream changelog.
+
+ -- Martin Pitt <mpitt@debian.org>  Wed, 22 Jun 2005 00:21:42 +0200
+
+libpg-perl (1:2.1.1-1) unstable; urgency=low
+
+  * New upstream version.
+  * Transition to new PostgreSQL architecture.
+  * debian/control:
+    - Changed build dependency postgresql-dev to libpq-dev.
+    - Do not build the libpgperl transition package any more.
+  * debian/rules:
+    - Use pg_config to determine include and library directories.
+    - Tweak internal variables of the generated Makefile to fix broken default
+      values of the new Perl's MakeMaker.
+
+ -- Martin Pitt <mpitt@debian.org>  Wed,  8 Jun 2005 14:46:34 +0200
+
+libpg-perl (1:2.0.2-4) unstable; urgency=low
+
+  * Pg.pm: Fixed typo in generated manpage, thanks to Julian Gilbey for
+    spotting this (closes: #275783)
+
+ -- Martin Pitt <mpitt@debian.org>  Mon, 18 Oct 2004 12:01:25 +0200
+
+libpg-perl (1:2.0.2-3) unstable; urgency=low
+
+  * Conflicts to and Replaces old libpgperl (i. e. << 1:2.0.2-1) to make
+    upgrading work in all cases (closes: #231490)
+
+ -- Martin Pitt <mpitt@debian.org>  Sat,  7 Feb 2004 00:17:46 +0100
+
+libpg-perl (1:2.0.2-2) unstable; urgency=low
+
+  * renamed source package: an unrelated package pgperl already existed which
+    was overwritten by the last upload
+
+ -- Martin Pitt <mpitt@debian.org>  Fri,  6 Feb 2004 10:42:31 +0100
+
+pgperl (1:2.0.2-1) unstable; urgency=low
+
+  * Separated source tree out of postgresql; thus a new epoch had to be
+    created, postgresql is already at 7.4.1
+  * Added examples
+  * don't ship plperl.so any more, this library has now moved to the core
+    postgresql package
+  * renamed package libpgperl to libpg-perl to comply with the Perl policy
+    (closes: #47821); offer an empty transition package libpgperl
+
+ -- Martin Pitt <mpitt@debian.org>  Fri, 16 Jan 2004 22:54:37 +0100