PPM::Make - Make a ppm package from a CPAN distribution |
PPM::Make - Make a ppm package from a CPAN distribution
my $ppm = PPM::Make->new( [options] ); $ppm->make_ppm();
See the supplied make_ppm
script for a command-line interface.
This module automates somewhat some of the steps needed to make
a ppm (Perl Package Manager) package from a CPAN distribution.
It attempts to fill in the ABSTRACT and AUTHOR attributes of
Makefile.PL, if these are not supplied, and also uses pod2html
to generate a set of html documentation. It also adjusts CODEBASE
of package.ppd to reflect the generated package.tar.gz
or package.zip archive. Such packages are suitable both for
local installation via
C:\.cpan\build\package_src> ppm install
and for distribution via a repository.
Options can be given as some combination of key/value pairs passed to the new() constructor (described below) and those specified in a configuration file. This file can either be that given by the value of the PPM_CFG environment variable or, if not set, a file called .ppmcfg at the top-level directory (on Win32) or under HOME (on Unix).
The configuration file is of an INI type. If a section default is specified as
[ default ] option1 = value1 option2 = value2
these values will be used as the default. Architecture-specific values may be specified within their own section:
[ MSWin32-x86-multi-thread-5.8 ] option1 = new_value1 option3 = value3
In this case, an architecture specified as MSWin32-x86-multi-thread-5.8 within PPM::Make will have option1 = new_value1, option2 = value2, and option3 = value3, while any other architecture will have option1 = value1 and option2 = value2. Options specified within the configuration file can be overridden by passing the option into the new() method of PPM::Make.
Valid options that may be specified within the configuration file are those of PPM::Make, described below. For the program and upload options (which take hash references), the keys (make, zip, unzip, tar, gzip), or (ppd, ar, host, user, passwd), respectively, should be specified. For binary options, a value of yes|on in the configuration file will be interpreted as true, while no|off will be interpreted as false.
The available options accepted by the new constructor are
perl Makefile.PL
, and arises in
setting the HREF attribute of the CODEBASE field
in the ppd file.
$Config{archname}
(or the value of the arch option, if given)
as a relative subdirectory in the HREF attribute of the
CODEBASE field in the ppd file.
perl Makefile.PL
, and arises in
setting the value of the INSTALL field in the ppd file.
If this begins with http:// or ftp://, so that the
script is assumed external, this will be
used as the HREF attribute for INSTALL.
perl Makefile.PL
, and arises in
setting the EXEC attribute of the INSTALL field
in the ppd file.
ppm
utility will be used to install
the module.
/path/to/q1
should be used
for program p1
, etc., rather than the ones PPM::Make finds. The
programs specified can be one of tar
, gzip
, zip
, unzip
,
or make
.
The steps to make the PPM distribution are as follows.
tar
and gzip
program must
be available. For unpacking and making .zip archives,
either Archive::Zip must be present, or a zip
and
unzip
program must be available. Finally, a make
program must be present.
C:\.cpan\build\package_src> perl Makefile.PL C:\.cpan\build\package_src> nmake C:\.cpan\build\package_src> nmake test
procedure. A failure in any of the tests will be considered fatal unless the ignore option is used. Additional arguments to these commands present in either CPAN::Config or present in the binary option to specify BINARY_LOCATION in Makefile.PL will be added.
pod2html
is used to generate a set of html documentation.
This is placed under the blib/html/site/lib/ subdirectory,
which ppm install
will install into the user's html tree.
nmake ppd
will
be edited appropriately. This includes filling in the
ABSTRACT and AUTHOR fields, if needed and possible,
and also filling in the CODEBASE field with the
name of the generated archive file. This will incorporate
a possible binary option used to specify
the HREF attribute of the CODEBASE field.
Two routines are used in doing this - parse_ppd
, for
parsing the ppd file, and print_ppd
, for generating
the modified file.
ppm
utility,
if available, will be used to install the distribution.
The clean option, if specified, will remove the build
directory and the distribution file for a distribution
specified with the dist option.
As well as the needed software for unpacking and
making .tar.gz and .zip archives, and a make
program, it is assumed in this that CPAN.pm is
available and already configured, either site-wide or
through a user's $HOME/.cpan/CPAN/MyConfig.pm.
Although the examples given above had a Win32 flavour, like PPM, no assumptions on the operating system are made in the module.
This program is copyright, 2002, by Randy Kobes <randy@theoryx5.uwinnipeg.ca>. It is distributed under the same terms as Perl itself.
make_ppm, and PPM.
PPM::Make - Make a ppm package from a CPAN distribution |