Subject: | [patch] better Makefile.PL |
Will require perl 5.6, generate better META.yml. I tried to make DB_File
not mandatory (as it hard to install it under Windows, but tests fail),
so just modified warning.
--
Alexandr Ciornii, http://chorny.net
Subject: | Makefile.PL.patch |
--- Makefile.PL.dist 2007-02-16 18:06:34.000000000 +0200
+++ Makefile.PL 2009-02-19 18:02:33.453125000 +0200
@@ -1,3 +1,4 @@
+use 5.006; #our
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
@@ -49,7 +50,7 @@
}
sub report_deps {
- if ($missing_req[0]) {
+ if (@missing_req) {
# print "\nSorry, RDF::Core can't be instaled. ";
print "The following modules are required:\n\n";
foreach (@missing_req) {
@@ -58,8 +59,9 @@
#exit 1;
}
- if ($missing_opt[0]) {
- print "\nRDF::Core can be instaled but its functionality will be limited\n";
+ if (@missing_opt) {
+ print "\nRDF::Core can be installed (without CPAN shell and without tests)\n";
+ print "but its functionality will be limited\n";
print "as the following modules are required to support some features:\n\n";
foreach (@missing_opt) {
print "$_, version $optional{$_} or later: $msg{$_}\n";
@@ -81,5 +83,9 @@
'dist' => {
'COMPRESS' => 'gzip',
'SUFFIX' => 'gz',
- }
+ },
+ ($ExtUtils::MakeMaker::VERSION ge '6.31'?
+ ('LICENSE' => 'open_source', ) : ()), #only one license allowed here
+ ($ExtUtils::MakeMaker::VERSION ge '6.48'?
+ ('MIN_PERL_VERSION' => 5.006, ) : ()), #For META.yml
);
Subject: | Makefile.PL |
use 5.006; #our
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
my %required = (
URI => 1.03,
XML::Parser => 2.30,
);
my %optional = (
DBI => 1.14,
DB_File => 1.72,
);
my %msg = (
URI => 'module for URI handling',
XML::Parser => 'Expat XML parser needed for RDF::Core::Parser',
DBI => 'module for a database connectivity (optional)',
DB_File => 'needed for Berkeley DB data storage',
);
my @missing_req = ();
my @missing_opt = ();
$| = 1;
sub get_dots {
return '.' x (30 - length shift);
}
sub check_deps {
my ($list, $result) = @_;
foreach (keys %$list) {
my $m = "$_ ($list->{$_})";
print "Checking for $m", get_dots($m);
my $try = "require $_;";
eval $try;
if ($@) {
print "missing!\n";
push @$result, $_;
} else {
my $version = '$' . "$_" . '::VERSION >= ' . $list->{$_};
if( eval $version ) {
print "ok\n";
} else {
print "old version!\n";
push @result, $_;
}
}
}
}
sub report_deps {
if (@missing_req) {
# print "\nSorry, RDF::Core can't be instaled. ";
print "The following modules are required:\n\n";
foreach (@missing_req) {
print "$_, version $required{$_} or later: $msg{$_}\n";
}
#exit 1;
}
if (@missing_opt) {
print "\nRDF::Core can be installed (without CPAN shell and without tests)\n";
print "but its functionality will be limited\n";
print "as the following modules are required to support some features:\n\n";
foreach (@missing_opt) {
print "$_, version $optional{$_} or later: $msg{$_}\n";
}
print "\nIf you want use the above described features,\n";
print "install or update the missing modules.\n\n"
}
}
check_deps(\%required, \@missing_req);
check_deps(\%optional, \@missing_opt);
report_deps;
WriteMakefile(
'PMLIBDIRS' => [ 'lib' ],
'NAME' => 'RDF::Core',
'VERSION_FROM' => 'lib/RDF/Core.pm', # finds $VERSION
'PREREQ_PM' => {%required, %optional},
'dist' => {
'COMPRESS' => 'gzip',
'SUFFIX' => 'gz',
},
($ExtUtils::MakeMaker::VERSION ge '6.31'?
('LICENSE' => 'open_source', ) : ()), #only one license allowed here
($ExtUtils::MakeMaker::VERSION ge '6.48'?
('MIN_PERL_VERSION' => 5.006, ) : ()), #For META.yml
);