brian d foy > Distribution-Guess-BuildSystem-0.11 > Distribution::Guess::BuildSystem

Download:
Distribution-Guess-BuildSystem-0.11.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.11   Source  

NAME ^

Distribution::Guess::BuildSystem - This is the description

SYNOPSIS ^

        use Distribution::Guess::BuildSystem;

        chdir $dist_dir;
        
        my $guesser = Distribution::Guess::BuildSystem->new(
                dist_dir => $dir
                );
        
        my $build_files   = $guesser->build_files; # Hash ref
        
        my $build_pl      = $guesser->has_build_pl;
        my $makefile_pl   = $guesser->has_makefile_pl;
        
        my $both          = $guesser->has_build_and_makefile;
        
        my $build_command = $guesser->build_commands; # Hash ref
        
        if( $guesser->uses_module_install ) 
                {
                my $version = $guesser->module_install_version;
                my $pita    = $guesser->uses_auto_install;
                }
                
        if( $guesser->uses_makemaker )   
                {
                my $version = $guesser->makemaker_version;
                my $make    = $guesser->make_command;
                }

DESCRIPTION ^

There are three major build system for Perl distributions:

The trick is to figure out which one you are supposed to use.

Methods

new
        dist_dir
dist_dir

Questions about the distribution

build_files

Returns an hash reference of build files found in the distribution. The keys are the filenames of the build files. The values

preferred_build_file

Returns the build file that you should use, even if there is more than one. Right now this is simple. If Build.PL is there, use it before Makefile.PL.

preferred_build_command

Returns the build command that you should use, even if there is more than one. Right now this is simple. If Build.PL is there, return perl. If not and Makefile.PL is there, return make.

build_file_paths

Returns an anonymous hash to the paths to the build files, based on the dist_dir argument to new and the return value of build_files. The keys are the file names and the values are the paths.

makefile_pl_path
build_pl_path
has_build_pl

Has the file name returned by build_pl.

has_makefile_pl

Has the file name returned by makefile_pl.

has_build_and_makefile

Has both the files returned by makefile_pl and build_pl.

make_command

Looks in %Config to see what perl discovered when someone built it if you can use a make variant to build the distribution.

perl_command

Returns the perl currently running if you can use perl to build the distribution.

build_commands

Returns a hash reference of the commands you can use to build the distribution. The keys are the commands, such as make or perl Build.PL.

uses_makemaker

The distro uses ExtUtils::Makemaker.

makemaker_version

Returns the version of Makemaker installed for the perl running this code.

uses_module_build

Returns true if this distribution uses Module::Build.

module_build_version

Returns the version of Module::Build install for perl running this code.

uses_module_install

Returns true if this distribution uses Module::Install.

uses_auto_install

Returns true if this distribution uses Module::Install and will use the auto_install feature.

This is a very simple test right now. If it finds the string auto_install in the build file, it returns true.

module_install_version

Returns the version of Module::Install.

uses_module_build_compat

Returns true if this distribution uses Module::Install::Compat and will use the create_makefile_pl feature.

This is a very simple test right now. If it finds the string create_makefile_pl in the build file, it returns true.

build_pl_wraps_makefile_pl

Returns true if Build.PL is a wrapper around Makefile.PL.

just_give_me_a_hash

Methods for strings

You may want to override or extend these, so they are methods.

makefile_pl

Returns the string used for the Makefile.PL filename. Seems stupid until you want to change it in a subclass, which you can do now that it's a method. :)

build_pl

Returns the string used for the Build.PL filename. Seems stupid until you want to change it in a subclass, which you can do now that it's a method. :)

makemaker_name

Returns the module name of Makemaker, which is ExtUtils::MakeMaker.

module_build_name

Return the string representing the name for Module::Build.

module_install_name

Return the string representing the name for Module::Install. By default this is inc::Module::Install.

module_install_dir

Returns the directory that contains Module::Install. This is the distribution directory because the module name is actually inc::Module::Install.

module_extractor_class

The name of the module that can get a list of used modules from a Perl file. By default this is Module::Extract::Use.

TO DO ^

SEE ALSO ^

SOURCE AVAILABILITY ^

This source is in Github:

        git://github.com/briandfoy/distribution-guess-buildsystem.git

AUTHOR ^

brian d foy, <bdfoy@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (c) 2008, brian d foy, All Rights Reserved.

You may redistribute this under the same terms as Perl itself.