Author: turnstep
Date: Sun Apr 13 19:46:50 2008
New Revision: 11075

Modified:
   DBD-Pg/trunk/Makefile.PL

Log:
Add a quick "help" option.


Modified: DBD-Pg/trunk/Makefile.PL
==============================================================================
--- DBD-Pg/trunk/Makefile.PL    (original)
+++ DBD-Pg/trunk/Makefile.PL    Sun Apr 13 19:46:50 2008
@@ -11,12 +11,14 @@
 
 my $lib;
 BEGIN {
-    my %sep = (MacOS   => ':',
+    my %sep = (
+                          MacOS   => ':',
                MSWin32 => '\\',
                os2     => '\\',
                VMS     => '\\',
                NetWare => '\\',
-               dos     => '\\');
+               dos     => '\\',
+                          );
     my $s = $sep{$^O} || '/';
     $lib = join $s, 't', 'lib';
 }
@@ -26,6 +28,40 @@
        print "WARNING! This is a test version ($VERSION) and should not be 
used in production!\n";
 }
 
+if (grep { /help/ } @ARGV) {
+       print qq{
+Usage: perl $0
+
+No other options are necessary, although you may need to
+set some evironment variables. See the README file for full details.
+
+In brief:
+
+By default Makefile.PL uses App::Info to find the location of the
+PostgreSQL library and include directories.  However, if you want to
+control it yourself, define the environment variables POSTGRES_INCLUDE
+and POSTGRES_LIB, or define just POSTGRES_HOME. Note that if you have
+compiled PostgreSQL with SSL support, you must define the POSTGRES_LIB
+environment variable and add "-lssl" to it, like this:
+
+export POSTGRES_LIB="/usr/local/pgsql/lib -lssl"
+
+The usual steps to install DBD::Pg:
+
+1.   perl Makefile.PL
+2.   make
+3.   make test
+4.   make install
+
+Do steps 1 to 3 as a normal user, not as root!
+
+If all else fails, email [EMAIL PROTECTED] for help.
+
+};
+       exit 1;
+
+}
+
 print "Configuring DBD::Pg $VERSION\n";
 
 my $POSTGRES_INCLUDE;
@@ -164,7 +200,7 @@
 }
 elsif ($os =~ /Win32/) {
        my $msdir = $POSTGRES_LIB;
-       $msdir =~ s#"$#/ms"#;
+       $msdir =~ s{"$}{/ms"};
        $opts{LIBS}[0] .= " -L$msdir";
 }
 
@@ -172,13 +208,13 @@
     $opts{LINKTYPE} = 'static';
 }
 
-sub MY::postamble {
-       no strict 'subs';
+sub MY::postamble { ## no critic ProhibitQualifiedSubDeclarations
+       no strict 'subs'; ## no critic ProhibitNoStrict
        my $string = DBI::DBD->dbd_postamble();
        use strict 'subs';
        ## Evil, evil stuff - but we really want to suppress the "duplicate 
function" message!
        $string =~ s/dependancy/dependency/g; ## why not, while we are here
-       $string =~ s#(BASEEXT\)/g)#$1; s/^do\\\(/dontdo\\\(/#;
+       $string =~ s{(BASEEXT\)/g)}{$1; s/^do\\\(/dontdo\\\(/};
 
         my $tags = <<'MAKE_FRAG';
 .PHONY: tags
@@ -233,7 +269,7 @@
 
 my $output = WriteMakefile(%opts);
 
-if (!exists $output->{EXTRALIBS} or 
+if (!exists $output->{EXTRALIBS} or
        ($output->{EXTRALIBS} !~ /\-lpq/ and $output->{EXTRALIBS} !~ /libpq/)) {
 
        my $makefile = exists $output->{MAKEFILE}

Reply via email to