$packlist = ExtUtils::Packlist->new("$opts{destdir}$Config{installarchlib}/.packlist");
-# manpages not to be installed
-my %do_not_install = map { ($_ => 1) } qw(
- Pod/Functions.pm
- XS/APItest.pm
- XS/Typemap.pm
-);
-
# Install the main pod pages.
pod2man({
map {
($_->[0], $_->[1])
} @{$state->{master}}
- }, $opts{man1dir}, $opts{man1ext});
+ }, $opts{man1dir}, $opts{man1ext}, 'pod');
# Install the pods for library modules.
-pod2man('lib', $opts{man3dir}, $opts{man3ext});
+{
+ # manpages not to be installed
+ my %do_not_install = map { ($_ => 1) }
+ qw(Pod/Functions.pm XS/APItest.pm XS/Typemap.pm);
+
+ my %modpods;
+ File::Find::find({no_chdir=>1,
+ wanted => sub {
+ # $_ is $File::Find::name when using no_chdir
+ if (-f $_ and /\.p(?:m|od)$/) {
+ my $pod = $_;
+ # Skip .pm files that have corresponding .pod files
+ return if $pod =~ s/\.pm$/.pod/ && -f $pod;
+ return if m!(?:^|/)t/!;
+ s!^lib/!!;
+ return if $do_not_install{$_};
+ return if is_duplicate_pod($File::Find::name);
+ $modpods{$_} = $File::Find::name;
+ }
+ }},
+ 'lib');
+
+ pod2man(\%modpods, $opts{man3dir}, $opts{man3ext}, 'lib');
+}
# Install the pods embedded in the installed scripts
my $has_man1dir = $opts{man1dir} ne '' && -d $opts{man1dir};
}
sub pod2man {
- my($what, $mandir, $manext) = @_;
+ my($modpods, $mandir, $manext, $where) = @_;
if ($mandir eq ' ' or $mandir eq '') {
- if (ref $what) {
+ if ($where) {
+ warn "Skipping installation of $where man pages.\n"
+ } else {
warn "Skipping installation of $_ man page.\n"
- foreach values %$what;
- } else {
- warn "Skipping installation of $what man pages.\n"
- }
- return;
+ foreach values %$modpods;
+ }
+ return;
}
if ($opts{verbose}) {
- if (ref $what) {
- print "installing $_\n"
- foreach sort keys %$what;
+ if ($where) {
+ print "installing from $where\n";
} else {
- print "installing from $what\n";
+ print "installing $_\n"
+ foreach sort keys %$modpods;
}
}
mkpath($mandir, $opts{verbose}, 0777) unless $opts{notify}; # In File::Path
- my $modpods;
- if (ref $what) {
- $modpods = $what;
- }
- else {
- # Make a list of all the .pm and .pod files in the directory.
- File::Find::find({no_chdir=>1,
- wanted => sub {
- # $_ is $File::Find::name when using no_chdir
- if (-f $_ and /\.p(?:m|od)$/) {
- my $pod = $_;
- # Skip .pm files that have corresponding .pod files
- return if $pod =~ s/\.pm$/.pod/ && -f $pod;
- return if m!(?:^|/)t/!;
- s!^\Q$what\E/!!;
- return if $do_not_install{$_};
- return if is_duplicate_pod($File::Find::name);
- $modpods->{$_} = $File::Find::name;
- }
- }},
- $what);
- }
-
foreach my $manpage (sort keys %$modpods) {
my $mod = $modpods->{$manpage};