CatalystX::Usul::Build - M::B subclass
This document describes CatalystX::Usul::Build version 0.6.$Revision: 1165 $
use CatalystX::Usul::Build; use MRO::Compat; my $builder = q(CatalystX::Usul::Build); my $class = $builder->subclass( class => 'Bob', code => <<'EOB' ); sub ACTION_instal { # Spelling mistake intentional my $self = shift; $self->next::method(); # Your application specific post installation code goes here return; } EOB
Subclasses Module::Build. Ask questions during the install phase. The answers to the questions determine where the application will be installed and which additional actions will take place. Should be generic enough for any web application
Prompts the user for information about how this installation is to be performed. User responses are saved to the build.xml file. The "config_attributes" method returns the list of questions to ask
Changes the $VERSION strings in all of the projects files
$VERSION
Updates license file and changelog
Optionally calls the ACTION_install method in Module::Build
ACTION_install
Next it performs the additional sequence of actions required to install the application. The "actions" method returns the list of additional steps required
Install a copy of App::cpanminus to the local lib
Install the applications dependencies to the local lib
Bootstrap a copy of local::lib into the project directory
Install a version of Perl using perlbrew to the local lib
Install a copy of perlbrew to the local lib
Create a tarball (in the parent of the project directory, the one with Build.PL in it). Contains the local lib built by the "_install_local_deps" action
Generates a report of dependencies used by the module. It is presented as three lists; a list of modules that you might want to add to the target list in Build.PL, a list of modules you might want to remove from Build.PL, and a list modules whose versions should be updated in Build.PL. The target list defaults to requires and can be changed to build_requires or configure_requires on the command line
Build.PL
Commits the current working copy as the next release
Unpack the tarball created by "_local_archive"
Create a local lib directory, populate it with dependencies and then include it in the application distribution
Removes the HTTP server deployment links. Deletes the database. Deletes the owner id and the two groups that were created when the application was installed. Does not delete the application files and directories
Upload distribution to CPAN
$current_list_of_actions = $builder->actions( $new_list_of_actions );
This accessor/mutator method defaults to the list defined in the $CONFIG{actions} package variable
$CONFIG{actions}
$cli = $builder->cli;
Returns an instance of CatalystX::Usul::Programs, the command line interface object
$current_list_of_attrs = $builder->config_attributes( $new_list_of_attrs );
This accessor/mutator method defaults to the list defined in the $CONFIG{attrs} package variable
$CONFIG{attrs}
$builder->dispatch( @_ );
Intercept the call to parent method and call "_setup_plugins" first
$builder->dist_description;
Returns the description section from the POD in the main application class
$builder->make_tarball( $dir, $archive );
Prepends updir to the file name and calls make_tarball. The $archive defaults to $dir
updir
$archive
$dir
$builder->patch_file( $path, $patch );
Apply a patch to the specified file
$builder->process_files( $source, $destination );
Handles the processing of files other than library modules and programs. Uses the Bob::skip_pattern defined in the subclass to select only those files that should be processed. Copies files from source to destination, creating the destination directories as required. Source can be a single file or a directory. The destination is optional and defaults to blib
$builder->process_local_files();
Causes the local lib to be copied to blib during the build process
Return the URI of the VCS repository for this project. Return undef if we are not using svn or the repository is a local file path
Returns the URI of the VCS repository for this project
$regexp = $builder->skip_pattern( $new_regexp );
Accessor/mutator method. Used by "_copy_file" to skip processing files that match this pattern. Set to false to not have a skip list
All question methods are passed $config and return the new value for one of it's attributes
$config
Always returns true. This dummy question is used to trigger the suppression of any further questions once the build phase is complete
Should we execute the Module::Build install method. Answer no if the distribution tarball was unpacked into the directory where the application is going to be executed from, e.g. one's home directory for non-root installations
Prompt for the installation prefix. The application name and version directory are automatically appended. All of the application will be installed to this path. The default is /opt
The phase number represents the reason for the installation. It is encoded into the name of the application home directory. At runtime the application will load some configuration data that is dependent upon this value
Prompt for permission to execute the post installation commands
Dummy question returns the version part of the installation directory
All action methods are passed $config
Copies files as defined in the $config->{copy_files} attribute. Each item in this list is a hash ref containing from and to keys
$config->{copy_files}
Create the directory paths specified in the list $config->{create_dirs} if they do not exist
$config->{create_dirs}
Create the files specified in the list $config->{create_files} if they do not exist
$config->{create_files}
Edit the path that points to the application install directory in /etc/default/{app-name}. Edit the same path in the {prefix}_admin program which runs setuid root. Hence taint mode is on and it cannot aquire the path
Creates some symbolic links
$config = $builder->_ask_questions( $config );
Called from the "ACTION_install" method. Writes the $config hash to file for later use by the post install commands
$builder->_commit_release( 'Release message for VCS log' );
Commits the release to the VCS
$builder->_copy_file( $source, $destination );
Called by "process_files". Copies the $source file to the $destination directory
$source
$destination
$builder->_cpan_upload;
Called by "ACTION_upload". Uses CPAN::Uploader (which it loads on demand) to do the lifting. Reads from the users .pause in their $ENV{HOME} directory
$ENV{HOME}
$config = $builder->_get_config( $config_hash_ref );
Will merge the Module::Build notes hash with the passed config hash ref and the %CONFIG hash in. Caches the result
notes
%CONFIG
$builder->_log_info( @list_of_messages );
Add newlines to the messages before calling parent method
$base = $builder->_set_base_path( $config );
Sets the Module::Build install_base attribute to the base directory for this installation. Returns that path. Also sets; bin, lib, and var directory paths as appropriate. Called from the "ACTION_install" method
$builder->_setup_plugins
Loads any plugins it finds in the CX::U::Plugin::Build namespace. The $builder-config> setup_plugins attribute is passed to setup_plugins
CX::U::Plugin::Build
$builder-
$builder->_update_changelog( $config, $version );
Update the version number and date/time stamp in the Changes file
None
Stores config information in the file var/etc/cli.xml
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
<Support at RoxSoft.co.uk>
Copyright (c) 2011 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install CatalystX::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Usul
CPAN shell
perl -MCPAN -e shell install CatalystX::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.