In perl.git, the branch nicholas/migrate-Pod-converters has been updated <http://perl5.git.perl.org/perl.git/commitdiff/d3bc6aa63a6a5b0edf9948f07d2571be8049339c?hp=ce41b7f24c1dd8024fc3b77f9c85f8b0d85908ef>
- Log ----------------------------------------------------------------- commit d3bc6aa63a6a5b0edf9948f07d2571be8049339c Author: Nicholas Clark <[email protected]> Date: Tue Oct 5 19:30:59 2010 +0100 Generate the core-only Makefile.PL for podlators using make_ext. Using make_ext to generate it uses less code than committing a special core-only Makefile.PL to the repository, and is no more complex. ----------------------------------------------------------------------- Summary of changes: MANIFEST | 1 - Porting/Maintainers.pl | 2 - cpan/podlators/Makefile.PL | 27 ------------------------ make_ext.pl | 48 ++++++++++++++++++++++++++----------------- 4 files changed, 29 insertions(+), 49 deletions(-) delete mode 100644 cpan/podlators/Makefile.PL diff --git a/MANIFEST b/MANIFEST index 7ddcc66..cf55abf 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1644,7 +1644,6 @@ cpan/podlators/lib/Pod/Text/Color.pm Convert POD data to color ASCII text cpan/podlators/lib/Pod/Text/Overstrike.pm Convert POD data to formatted overstrike text cpan/podlators/lib/Pod/Text.pm Pod-Parser - convert POD data to formatted ASCII text cpan/podlators/lib/Pod/Text/Termcap.pm Convert POD data to ASCII text with format escapes -cpan/podlators/Makefile.PL cpan/podlators/scripts/pod2man.PL Precursor for translator to turn pod into manpage cpan/podlators/scripts/pod2text.PL Precursor for translator to turn pod into text cpan/podlators/t/basic.cap podlators test diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 247b58b..3fd6a98 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1203,8 +1203,6 @@ use File::Glob qw(:case); 'MAINTAINER' => 'rra', 'DISTRIBUTION' => 'RRA/podlators-2.3.1.tar.gz', 'FILES' => q[cpan/podlators], - 'EXCLUDED' => [ qw{ Makefile.PL } ], - 'CUSTOMIZED' => [ qw{ Makefile.PL } ], 'UPSTREAM' => 'cpan', }, diff --git a/cpan/podlators/Makefile.PL b/cpan/podlators/Makefile.PL deleted file mode 100644 index de3288d..0000000 --- a/cpan/podlators/Makefile.PL +++ /dev/null @@ -1,27 +0,0 @@ -# core-only Makefile.PL -use strict; -use ExtUtils::MakeMaker; -require File::Copy; - -my @scripts = qw(pod2man.PL pod2text.PL); -my $script_ext = $^O eq 'VMS' ? '.com' : ''; -my %pod_scripts; - -foreach (@scripts) { - File::Copy::copy("scripts/$_", $_) - or die "Can't copy scripts/$_ to $_: $!"; - my $output = s/.PL$/$script_ext/r; - $pod_scripts{$_} = $output; -} - -my @exe_files = values %pod_scripts; - -WriteMakefile ( - NAME => 'Pod', - DISTNAME => 'podlators', - VERSION_FROM => 'VERSION', - realclean => { FILES => "@scripts" }, - PL_FILES => \%pod_scripts, - EXE_FILES => \...@exe_files, - clean => { FILES => "@exe_files" }, -); diff --git a/make_ext.pl b/make_ext.pl index a4a6ea7..8f3e6db 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -321,29 +321,39 @@ sub build_extension { if (!-f $makefile) { if (!-f 'Makefile.PL') { print "\nCreating Makefile.PL in $ext_dir for $mname\n"; - # We need to cope well with various possible layouts - my @dirs = split /::/, $mname; - my $leaf = pop @dirs; - my $leafname = "$leaf.pm"; - my $pathname = join '/', @dirs, $leafname; - my @locations = ($leafname, $pathname, "lib/$pathname"); - my $fromname; - foreach (@locations) { - if (-f $_) { - $fromname = $_; - last; + my ($fromname, $key, $value); + if ($mname eq 'podlators') { + # We need to special case this somewhere, and this is fewer + # lines of code than a core-only Makefile.PL, and no more + # complex + $fromname = 'VERSION'; + $key = 'DISTNAME'; + $value = 'podlators'; + $mname = 'Pod'; + } else { + $key = 'ABSTRACT_FROM'; + # We need to cope well with various possible layouts + my @dirs = split /::/, $mname; + my $leaf = pop @dirs; + my $leafname = "$leaf.pm"; + my $pathname = join '/', @dirs, $leafname; + my @locations = ($leafname, $pathname, "lib/$pathname"); + foreach (@locations) { + if (-f $_) { + $fromname = $_; + last; + } } - } - unless ($fromname) { - die "For $mname tried @locations in in $ext_dir but can't find source"; + unless ($fromname) { + die "For $mname tried @locations in in $ext_dir but can't find source"; + } + ($value = $fromname) =~ s/\.pm\z/.pod/; + $value = $fromname unless -e $value; } - my $pod_name; - ($pod_name = $fromname) =~ s/\.pm\z/.pod/; - $pod_name = $fromname unless -e $pod_name; open my $fh, '>', 'Makefile.PL' or die "Can't open Makefile.PL for writing: $!"; - printf $fh <<'EOM', $0, $mname, $fromname, $pod_name; + printf $fh <<'EOM', $0, $mname, $fromname, $key, $value; #-*- buffer-read-only: t -*- # This Makefile.PL was written by %s. @@ -385,7 +395,7 @@ my @exe_files = values %%pod_scripts; WriteMakefile( NAME => '%s', VERSION_FROM => '%s', - ABSTRACT_FROM => '%s', + %-13s => '%s', realclean => { FILES => "@temps" }, (%%pod_scripts ? ( PL_FILES => \%%pod_scripts, -- Perl5 Master Repository
