Added new tests, fixed a bug, and cleaned up more code: Intermediate check-in
[p5sagit/Excel-Template.git] / Makefile.PL
index 89504ef..559544e 100644 (file)
@@ -1,16 +1,44 @@
+use strict;
+
 use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
+{
+    no strict 'refs';
+
+    my $libscan = \&{"ExtUtils::MM_Any::libscan"};
+    *{"ExtUtils::MM_Any::libscan"} = sub {
+        return '' unless $libscan->(@_);
+        return '' if $_[1] =~ /\.swp$/;
+        return $_[1];
+    };
+}
+
+my $prereqs = {
+    'Test::More'              => 0.01,
+    'XML::Parser'             => 0.01,
+    'IO::Scalar'              => 0.01,
+    'File::Basename'          => 0.01,
+    'Spreadsheet::WriteExcel' => 0.42,
+    'Spreadsheet::WriteExcel::Utility' => 0.01,
+};
+
+# The assumption is Perl 5.8.0 and greater doesn't need Unicode::String.
+
+if ($] < 5.008)
+{
+    eval { require Unicode::String; };
+    if ($@)
+    {
+        print "Note: If you want to work with Unicode, you will need to install";
+        print "the optional module Unicode::String and set USE_UNICODE to true.";
+    }
+}
+
 WriteMakefile(
     NAME         => 'Excel::Template',
     VERSION_FROM => 'lib/Excel/Template.pm', # finds $VERSION
-    AUTHOR       => 'Rob Kinyon (rkinyon@columbus.rr.com',
     ABSTRACT     => 'Excel::Template',
-    PREREQ_PM    => {
-                     'Test::Simple' => 0.44,
-                     'Spreadsheet::WriteExcel' => 0.42,
-                     'XML::Parser' => 0.01,
-                     'IO::Scalar' => 0.01,
-                     'IO::File' => 0.01,
-                    },
+    PREREQ_PM    => $prereqs,
+    ($] >= 5.005 ?
+       (ABSTRACT_FROM => 'lib/Excel/Template.pm',
+        AUTHOR       => 'Rob Kinyon (rob.kinyon@gmail.com)') : ()),
 );