NAME
CPANPLUS::Dist::Build
SYNOPSIS
my $build = CPANPLUS::Dist->new(
format => 'CPANPLUS::Dist::Build',
module => $modobj,
);
$build->prepare; # runs Module::Build->new_from_context;
$build->create; # runs build && build test
$build->install; # runs build install
DESCRIPTION
CPANPLUS::Dist::Build is a distribution class for Module::Build related modules. Using this package, you can create, install and uninstall perl modules. It inherits from CPANPLUS::Dist.
Normal users won't have to worry about the interface to this module, as it functions transparently as a plug-in to CPANPLUS and will just Do The Right Thing when it's loaded.
ACCESSORS
- parent()
-
Returns the
CPANPLUS::Moduleobject that parented this object. - status()
-
Returns the
Object::Accessorobject that keeps the status for this module.
STATUS ACCESSORS
All accessors can be accessed as follows: $build->status->ACCESSOR
- build_pl ()
-
Location of the Build file. Set to 0 explicitly if something went wrong.
- build ()
-
BOOL indicating if the
Buildcommand was successful. - test ()
-
BOOL indicating if the
Build testcommand was successful. - prepared ()
-
BOOL indicating if the
preparecall exited succesfully This gets set afterperl Build.PL - distdir ()
-
Full path to the directory in which the
preparecall took place, set after a call toprepare. - created ()
-
BOOL indicating if the
createcall exited succesfully. This gets set afterBuildandBuild test. - installed ()
-
BOOL indicating if the module was installed. This gets set after
Build installexits successfully. - uninstalled ()
-
BOOL indicating if the module was uninstalled properly.
- _create_args ()
-
Storage of the arguments passed to
createfor this object. Used for recursive calls when satisfying prerequisites. - _install_args ()
-
Storage of the arguments passed to
installfor this object. Used for recursive calls when satisfying prerequisites. - _mb_object ()
-
Storage of the
Module::Buildobject we used for this installation.
METHODS
format_available();
Returns a boolean indicating whether or not you can use this package to create and install modules in your environment.
Sets up the CPANPLUS::Dist::Build object for use. Effectively creates all the needed status accessors.
Called automatically whenever you create a new CPANPLUS::Dist object.
$dist->prepare()
$dist->create([perl => '/path/to/perl', buildflags => 'EXTRA=FLAGS', prereq_target => TARGET, force => BOOL, verbose => BOOL, skiptest => BOOL])
create preps a distribution for installation. This means it will run perl Build.PL, Build and Build test. This will also satisfy any prerequisites the module may have.
If you set skiptest to true, it will skip the Build test stage. If you set force to true, it will go over all the stages of the Build process again, ignoring any previously cached results. It will also ignore a bad return value from Build test and still allow the operation to return true.
Returns true on success and false on failure.
You may then call $dist->install on the object to actually install it. Returns true on success and false on failure.
$dist->install([verbose => BOOL, perl => /path/to/perl])
Actually installs the created dist.
Returns true on success and false on failure.
KNOWN ISSUES
Below are some of the known issues with Module::Build, that we hope the authors will resolve at some point, so we can make full use of Module::Build's power. The number listed is the bug number on rt.cpan.org.
Uninstall modules installed by Module::Build (#13308)
Module::Build doesn't write a so called
packlistfile, which holds a list of all files installed by a distribution. Without this file we don't know what to remove. Until Module::Build generates thispacklist, we are unable to remove any installations done by it.Module::Build's version comparison is not supported.
Module::Build has its own way of defining what versions are considered satisfactory for a prerequisite, and which ones aren't. This syntax is something specific to Module::Build and we currently have no way to see if a module on disk, on cpan or something similar is satisfactory according to Module::Build's version comparison scheme. As a work around, we now simply assume that the most recent version on CPAN satisfies a dependency.
Module::Build doesn't support 'PREFIX' (#8759)
Module::Build doens't support the standard
Makefile.PLargumentPREFIXand dies if it is provided. Even though that's not usually a problem, sometimes M::B enabled distros ship aMakefile.PLthat calls theBuild.PLunder the hood. In these cases, aPREFIXmight be provided andModule::Buildwill die.Module::Build masquerades as Makefile.PL but is not compatible (#13145)
Related to the previous entry,
Module::Buildcan create aMakefile.PLwhich under the hood invokesModule::Build. It however does not support all the options thatExtUtils::MakeMakerdoes, and will die if you try to invoke the file with one of those options.Module::Build can not be upgraded using it's own API (#13169)
This is due to the fact that the Build file insists on adding a path to
@INCwhich force the loading of thenot yet installedModule::Build when it shells out to run it's own build procedure:Module::Build does not provide access to install history (#9793)
Module::Buildruns the create, test and install procedures in it's own processes, but does not provide access to any diagnostic messages of those processes. As an end result, we can not offer these diagnostic messages when, for example, reporting automated build failures to sites liketesters.cpan.org.
AUTHOR
This module by Jos Boumans <kane@cpan.org>.
COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001, 2002, 2003, 2004, 2005 Jos Boumans <kane@cpan.org>. All rights reserved.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.