.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CPANPLUS::Dist::MM 3" .TH CPANPLUS::Dist::MM 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME CPANPLUS::Dist::MM \- distribution class for MakeMaker related modules .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& $mm = CPANPLUS::Dist::MM\->new( module => $modobj ); \& \& $mm\->create; # runs make && make test \& $mm\->install; # runs make install .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CW\*(C`CPANPLUS::Dist::MM\*(C'\fR is a distribution class for MakeMaker related modules. Using this package, you can create, install and uninstall perl modules. It inherits from \f(CW\*(C`CPANPLUS::Dist\*(C'\fR. .SH ACCESSORS .IX Header "ACCESSORS" .IP \fBparent()\fR 4 .IX Item "parent()" Returns the \f(CW\*(C`CPANPLUS::Module\*(C'\fR object that parented this object. .IP \fBstatus()\fR 4 .IX Item "status()" Returns the \f(CW\*(C`Object::Accessor\*(C'\fR object that keeps the status for this module. .SH "STATUS ACCESSORS" .IX Header "STATUS ACCESSORS" All accessors can be accessed as follows: \f(CW$mm\fR\->status\->ACCESSOR .IP "makefile ()" 4 .IX Item "makefile ()" Location of the Makefile (or Build file). Set to 0 explicitly if something went wrong. .IP "make ()" 4 .IX Item "make ()" BOOL indicating if the \f(CW\*(C`make\*(C'\fR (or \f(CW\*(C`Build\*(C'\fR) command was successful. .IP "test ()" 4 .IX Item "test ()" BOOL indicating if the \f(CW\*(C`make test\*(C'\fR (or \f(CW\*(C`Build test\*(C'\fR) command was successful. .IP "prepared ()" 4 .IX Item "prepared ()" BOOL indicating if the \f(CW\*(C`prepare\*(C'\fR call exited successfully This gets set after \f(CW\*(C`perl Makefile.PL\*(C'\fR .IP "distdir ()" 4 .IX Item "distdir ()" Full path to the directory in which the \f(CW\*(C`prepare\*(C'\fR call took place, set after a call to \f(CW\*(C`prepare\*(C'\fR. .IP "created ()" 4 .IX Item "created ()" BOOL indicating if the \f(CW\*(C`create\*(C'\fR call exited successfully. This gets set after \f(CW\*(C`make\*(C'\fR and \f(CW\*(C`make test\*(C'\fR. .IP "installed ()" 4 .IX Item "installed ()" BOOL indicating if the module was installed. This gets set after \&\f(CW\*(C`make install\*(C'\fR (or \f(CW\*(C`Build install\*(C'\fR) exits successfully. .IP "uninstalled ()" 4 .IX Item "uninstalled ()" BOOL indicating if the module was uninstalled properly. .IP "_create_args ()" 4 .IX Item "_create_args ()" Storage of the arguments passed to \f(CW\*(C`create\*(C'\fR for this object. Used for recursive calls when satisfying prerequisites. .IP "_install_args ()" 4 .IX Item "_install_args ()" Storage of the arguments passed to \f(CW\*(C`install\*(C'\fR for this object. Used for recursive calls when satisfying prerequisites. .SH METHODS .IX Header "METHODS" .ie n .SS "$bool = $dist\->\fBformat_available()\fP;" .el .SS "\f(CW$bool\fP = \f(CW$dist\fP\->\fBformat_available()\fP;" .IX Subsection "$bool = $dist->format_available();" Returns a boolean indicating whether or not you can use this package to create and install modules in your environment. .ie n .SS "$bool = $dist\->\fBinit()\fP;" .el .SS "\f(CW$bool\fP = \f(CW$dist\fP\->\fBinit()\fP;" .IX Subsection "$bool = $dist->init();" Sets up the \f(CW\*(C`CPANPLUS::Dist::MM\*(C'\fR object for use. Effectively creates all the needed status accessors. .PP Called automatically whenever you create a new \f(CW\*(C`CPANPLUS::Dist\*(C'\fR object. .ie n .SS "$bool = $dist\->prepare([perl => '/path/to/perl', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])" .el .SS "\f(CW$bool\fP = \f(CW$dist\fP\->prepare([perl => '/path/to/perl', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])" .IX Subsection "$bool = $dist->prepare([perl => '/path/to/perl', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])" \&\f(CW\*(C`prepare\*(C'\fR preps a distribution for installation. This means it will run \f(CW\*(C`perl Makefile.PL\*(C'\fR and determine what prerequisites this distribution declared. .PP If you set \f(CW\*(C`force\*(C'\fR to true, it will go over all the stages of the \&\f(CW\*(C`prepare\*(C'\fR process again, ignoring any previously cached results. .PP When running \f(CW\*(C`perl Makefile.PL\*(C'\fR, the environment variable \&\f(CW\*(C`PERL5_CPANPLUS_IS_EXECUTING\*(C'\fR will be set to the full path of the \&\f(CW\*(C`Makefile.PL\*(C'\fR that is being executed. This enables any code inside the \f(CW\*(C`Makefile.PL\*(C'\fR to know that it is being installed via CPANPLUS. .PP Returns true on success and false on failure. .PP You may then call \f(CW\*(C`$dist\->create\*(C'\fR on the object to create the installable files. .ie n .SS "$href = $dist\->_find_prereqs( file => '/path/to/Makefile', [verbose => BOOL])" .el .SS "\f(CW$href\fP = \f(CW$dist\fP\->_find_prereqs( file => '/path/to/Makefile', [verbose => BOOL])" .IX Subsection "$href = $dist->_find_prereqs( file => '/path/to/Makefile', [verbose => BOOL])" Parses a \f(CW\*(C`Makefile\*(C'\fR for \f(CW\*(C`PREREQ_PM\*(C'\fR entries and distills from that any prerequisites mentioned in the \f(CW\*(C`Makefile\*(C'\fR .PP Returns a hash with module-version pairs on success and false on failure. .ie n .SS "$bool = $dist\->create([perl => '/path/to/perl', make => '/path/to/make', makeflags => 'EXTRA=FLAGS', prereq_target => TARGET, skiptest => BOOL, force => BOOL, verbose => BOOL])" .el .SS "\f(CW$bool\fP = \f(CW$dist\fP\->create([perl => '/path/to/perl', make => '/path/to/make', makeflags => 'EXTRA=FLAGS', prereq_target => TARGET, skiptest => BOOL, force => BOOL, verbose => BOOL])" .IX Subsection "$bool = $dist->create([perl => '/path/to/perl', make => '/path/to/make', makeflags => 'EXTRA=FLAGS', prereq_target => TARGET, skiptest => BOOL, force => BOOL, verbose => BOOL])" \&\f(CW\*(C`create\*(C'\fR creates the files necessary for installation. This means it will run \f(CW\*(C`make\*(C'\fR and \f(CW\*(C`make test\*(C'\fR. This will also scan for and attempt to satisfy any prerequisites the module may have. .PP If you set \f(CW\*(C`skiptest\*(C'\fR to true, it will skip the \f(CW\*(C`make test\*(C'\fR stage. If you set \f(CW\*(C`force\*(C'\fR to true, it will go over all the stages of the \&\f(CW\*(C`make\*(C'\fR process again, ignoring any previously cached results. It will also ignore a bad return value from \f(CW\*(C`make test\*(C'\fR and still allow the operation to return true. .PP Returns true on success and false on failure. .PP You may then call \f(CW\*(C`$dist\->install\*(C'\fR on the object to actually install it. .ie n .SS "$bool = $dist\->install([make => '/path/to/make', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])" .el .SS "\f(CW$bool\fP = \f(CW$dist\fP\->install([make => '/path/to/make', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])" .IX Subsection "$bool = $dist->install([make => '/path/to/make', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])" \&\f(CW\*(C`install\*(C'\fR runs the following command: make install .PP Returns true on success, false on failure. .ie n .SS "$bool = $dist\->write_makefile_pl([force => BOOL, verbose => BOOL])" .el .SS "\f(CW$bool\fP = \f(CW$dist\fP\->write_makefile_pl([force => BOOL, verbose => BOOL])" .IX Subsection "$bool = $dist->write_makefile_pl([force => BOOL, verbose => BOOL])" This routine can write a \f(CW\*(C`Makefile.PL\*(C'\fR from the information in a module object. It is used to write a \f(CW\*(C`Makefile.PL\*(C'\fR when the original author forgot it (!!). .PP Returns 1 on success and false on failure. .PP The file gets written to the directory the module's been extracted to.