-runpod2man('utils', $man1dir, $man1ext, 'c2ph');
-runpod2man('utils', $man1dir, $man1ext, 'h2ph');
-runpod2man('utils', $man1dir, $man1ext, 'h2xs');
-runpod2man('utils', $man1dir, $man1ext, 'perldoc');
-runpod2man('utils', $man1dir, $man1ext, 'perlbug');
-runpod2man('utils', $man1dir, $man1ext, 'pl2pm');
-runpod2man('utils', $man1dir, $man1ext, 'splain');
-runpod2man('x2p', $man1dir, $man1ext, 's2p');
-runpod2man('x2p', $man1dir, $man1ext, 'a2p.pod');
-runpod2man('pod', $man1dir, $man1ext, 'pod2man');
-runpod2man('pod', $man1dir, $man1ext, 'pod2html');
-
-# It would probably be better to have this page linked
-# to the c2ph man page. Or, this one could say ".so man1/c2ph.1",
-# but then it would have to pay attention to $man1dir and $man1ext.
-runpod2man('utils', $man1dir, $man1ext, 'pstruct');
-
-runpod2man('lib/ExtUtils', $man1dir, $man1ext, 'xsubpp');
-
-sub runpod2man {
- # $script is script name if we are installing a manpage embedded
- # in a script, undef otherwise
- my($poddir, $mandir, $manext, $script) = @_;
-
- my($downdir); # can't just use .. when installing xsubpp manpage
-
- $downdir = $poddir;
- $downdir =~ s:[^/]+:..:g;
- my($builddir) = Cwd::getcwd();
+my $has_man1dir = $opts{man1dir} ne '' && -d $opts{man1dir};
+open UTILS, "utils.lst" or die "Can't open 'utils.lst': $!";
+while (<UTILS>) {
+ next if /^#/;
+ chomp;
+ $_ = $1 if /#.*pod\s*=\s*(\S+)/;
+ my ($where, $what) = m|^(\S*)/(\S+)|;
+ pod2man($where, $opts{man1dir}, $opts{man1ext}, $what);
+ if ($has_man1dir) {
+ if (my ($where2, $what2) = m|#.*link\s*=\s*(\S+)/(\S+)|) {
+ my $old = "$opts{man1dir}/$what.$opts{man1ext}";
+ my $new = "$opts{man1dir}/$what2.$opts{man1ext}";
+ unlink($new);
+ link($old, $new);
+ my $xold = $old;
+ $xold =~ s/^\Q$opts{'destdir'}\E// if $opts{'destdir'};
+ my $xnew = $new;
+ $xnew =~ s/^\Q$opts{'destdir'}\E// if $opts{'destdir'};
+ $packlist->{$xnew} = { from => $xold, type => 'link' };
+ }
+ }
+}