Still More Perl Lightning Articles
by Phil Crow, Josh McAdams, Steven Schubiger, chromatic
|
Pages: 1, 2, 3, 4
Data Section
Module::Build::Convert comes with a rather huge data section containing the argument conversion table, default arguments, sorting order, and begin and end code. If you wish to change this data, consider making a ~/.make2buildrc file by launching make2build with the -rc switch. Do not edit the Data section within Module::Build::Convert directly, unless you are sure you want to submit a patch.
Argument Conversion
On the left-hand side is the MakeMaker's argument name, and on the right-hand side the Module::Build's equivalent.
NAME module_name
DISTNAME dist_name
ABSTRACT dist_abstract
AUTHOR dist_author
VERSION dist_version
VERSION_FROM dist_version_from
PREREQ_PM requires
PL_FILES PL_files
PM pm_files
MAN1PODS pod_files
XS xs_files
INC include_dirs
INSTALLDIRS installdirs
DESTDIR destdir
CCFLAGS extra_compiler_flags
EXTRA_META meta_add
SIGN sign
LICENSE license
clean.FILES @add_to_cleanup
Default Arguments
These are default Module::Build arguments to added. Arguments with a leading # are ignored.
#build_requires HASH
#recommends HASH
#conflicts HASH
license unknown
create_readme 1
create_makefile_pl traditional
Sorting Order
This is the sorting order for Module::Build arguments.
module_name
dist_name
dist_abstract
dist_author
dist_version
dist_version_from
requires
build_requires
recommends
conflicts
PL_files
pm_files
pod_files
xs_files
include_dirs
installdirs
destdir
add_to_cleanup
extra_compiler_flags
meta_add
sign
license
create_readme
create_makefile_pl
Begin Code
Code that precedes converted Module::Build arguments. $(UPPERCASE) are stubs being substituted by Module::Build code.
use strict;
use warnings;
use Module::Build;
$MAKECODE
my $b = Module::Build->new
$INDENT(
End Code
Code that follows converted Module::Build arguments. $(UPPERCASE) are stubs being substituted by Module::Build code.
$INDENT);
$b->create_build_script;
$MAKECODE
make2build Basic Usage
Using make2build is as easy as launching it in the directory of the distribution of which Makefile.PL you wish to convert.
For example:
% make2build
You may also provide the full path to the distribution, assuming, for example, you didn't cd directly into the distribution directory.
% make2build /path/to/HTML-Tagset*
In both cases, the command will convert any found Makefile.PL files and will generate no output because make2build acts quiet by default.
make2build Switches
As make2build aims to be a proper script, it of course, provides both the -h (help screen) and -V (version) switches.
% make2build -h
% make2build -V
In case you end up with a mangled Build.PL written, you can examine the parsing process by launching make2build with the -d switch, enabling the pseudo-interactive debugging mode.
% make2build -d
Should you not like the indentation length or judge it to be too small, increase it via the -l switch followed by an integer.
% make2build -l length
If you don't agree with the sorting order predefined in Module::Build::Convert, you may enforce the native sorting order, which strives to arrange standard arguments with those seen available in the Makefile.PL.
% make2build -n
The argument conversion table, default arguments to add, the sorting order of the arguments, and the begin and end code aren't absolute, either. Change them by invoking make2build with the -rc switch to create a resource configuration file in the home directory of the current user; that is likely ~/.make2build.rc.
% make2build -rc
While make2build is quiet by default, there are two verbosity levels. To enforce verbosity level 1, launch make2build with -v. To enforce verbosity level 2, use -vv.
With -v, the code will warn about Makefile.PL options it does not understand or skips. With -vv, it will accumulate -v output and the entire generated Build.PL.
% make2build -v
% make2build -vv
You may execute the Makefile.PL in first place, but such usage is deprecated because Module::Build::Convert downgrades automatically when needed.
% make2build -x (deprecated)

