use strict;
require 5.005_03;
require Exporter;
$VERSION = '0.03';
my $Is_VMS = $^O eq 'VMS';
=head1 NAME
ExtUtils::Command::MM - Commands for the MM's to use in Makefiles
=head1 SYNOPSIS
perl "-MExtUtils::Command::MM" -e "function" "--" arguments...
=head1 DESCRIPTION
B<FOR INTERNAL USE ONLY!> The interface is not stable.
ExtUtils::Command::MM encapsulates code which would otherwise have to
be done with large "one" liners.
Any $(FOO) used in the examples are make variables, not Perl.
=over 4
=item B<test_harness>
test_harness($verbose, @test_libs);
Runs the tests on @ARGV via Test::Harness passing through the $verbose
flag. Any @test_libs will be unshifted onto the test's @INC.
@test_libs are run in alphabetical order.
=cut
sub test_harness {
}
=item B<pod2man>
pod2man( '--option=value',
$podfile1 => $manpage1,
$podfile2 => $manpage2,
...
);
# or args on @ARGV
pod2man() is a function performing most of the duties of the pod2man
program. Its arguments are exactly the same as pod2man as of 5.8.0
with the addition of:
--perm_rw octal permission to set the resulting manpage to
And the removal of:
--verbose/-v
--help/-h
If no arguments are given to pod2man it will read from @ARGV.
=cut
sub pod2man {
my %options = ();
# We will cheat and just use Getopt::Long. We fool it by putting
# our arguments into @ARGV. Should be safe.
'section|s=s', 'release|r=s', 'center|c=s',
'date|d=s', 'fixed=s', 'fixedbold=s', 'fixeditalic=s',
'fixedbolditalic=s', 'official|o', 'quotes|q=s', 'lax|l',
'name|n=s', 'perm_rw:i'
);
# If there's no files, don't bother going further.
return 0 unless @ARGV;
# Official sets --center, but don't override things explicitly set.
}
# This isn't a valid Pod::Man option and is only accepted for backwards
# compatibility.
do {{ # so 'next' works
next if ((-e $man) &&
(-M $man < -M "Makefile"));
print "Manifying $man\n";
or do { warn("Could not install $man\n"); next };
or do { warn("chmod $options{perm_rw} $man: $!\n"); next };
}
}} while @ARGV;
return 1;
}
=item B<warn_if_old_packlist>
perl "-MExtUtils::Command::MM" -e warn_if_old_packlist <somefile>
Displays a warning that an old packlist file was found. Reads the
filename from @ARGV.
=cut
sub warn_if_old_packlist {
return unless -f $packlist;
print <<"PACKLIST_WARNING";
$packlist.
}
=item B<perllocal_install>
perl "-MExtUtils::Command::MM" -e perllocal_install
<type> <module name> <key> <value> ...
perl "-MExtUtils::Command::MM" -e perllocal_install
<type> <module name> < <key> <value> ...
Prints a fragment of POD suitable for appending to perllocal.pod.
Arguments are read from @ARGV.
'type' is the type of what you're installing. Usually 'Module'.
'module name' is simply the name of your module. (Foo::Bar)
installed into which directory your module was out into
LINKTYPE dynamic or static linking
VERSION module version number
EXE_FILES any executables installed in a space seperated
list
=cut
sub perllocal_install {
# VMS feeds args as a piped file on STDIN since it usually can't
# fit all the args on a single command line.
my $pod;
=over 4
do {
=item *
} while(@ARGV);
$pod .= "=back\n\n";
print $pod;
return 1;
}
=item B<uninstall>
perl "-MExtUtils::Command::MM" -e uninstall <packlist>
A wrapper around ExtUtils::Install::uninstall(). Warns that
uninstallation is deprecated and doesn't actually perform the
uninstallation.
=cut
sub uninstall {
my($packlist) = shift;
print <<'WARNING';
print <<'WARNING';
}
=back
=cut
1;