.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Module::Install 3" .TH Module::Install 3 2024-09-01 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Module::Install \- Standalone, extensible Perl module installer .SH SYNOPSIS .IX Header "SYNOPSIS" In your \fIMakefile.PL\fR: (Recommended Usage) .PP .Vb 1 \& use inc::Module::Install; \& \& # Define metadata \& name \*(AqYour\-Module\*(Aq; \& all_from \*(Aqlib/Your/Module.pm\*(Aq; \& \& # Specific dependencies \& requires \*(AqFile::Spec\*(Aq => \*(Aq0.80\*(Aq; \& test_requires \*(AqTest::More\*(Aq => \*(Aq0.42\*(Aq; \& recommends \*(AqText::CSV_XS\*(Aq=> \*(Aq0.50\*(Aq; \& no_index \*(Aqdirectory\*(Aq => \*(Aqdemos\*(Aq; \& install_script \*(Aqmyscript\*(Aq; \& \& WriteAll; .Ve .PP Quickly upgrade a legacy ExtUtil::MakeMaker installer: .PP .Vb 2 \& use inc::Module::Install; \& WriteMakefile( ... ); .Ve .SH WARNING .IX Header "WARNING" Please note that while \fBModule::Install\fR pioneered many great ideas in its time, its primary benefits have been better achieved by the authoring tool Dist::Zilla, and its spinoffs Dist::Milla and Minilla. These tools allow the author to build and maintain distributions with DWIM convenience, while the distribution is installed directly by ExtUtils::MakeMaker or similar installation tools, avoiding the complexity of bundling the installer. Dist::Zilla additionally has a more robust plugin system which makes it easier to keep up with changes to the CPAN::Meta::Spec and add other new functionality. Use of \fBModule::Install\fR for new distributions is therefore discouraged by the maintainers. .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBModule::Install\fR is a package for writing installers for CPAN (or CPAN-like) distributions that are clean, simple, minimalist, act in a strictly correct manner with ExtUtils::MakeMaker, and will run on any Perl installation version 5.005 or newer. .PP The intent is to make it as easy as possible for CPAN authors (and especially for first-time CPAN authors) to have installers that follow all the best practices for distribution installation, but involve as much DWIM (Do What I Mean) as possible when writing them. .SS "Writing Module::Install Installers" .IX Subsection "Writing Module::Install Installers" The quickest way to get started with Module::Install is to copy the "SYNOPSIS" from above and save it as your own \fIMakefile.PL\fR. Then modify the file to suit your own particular case, using the list of commands documented in "COMMON COMMANDS" below. .PP If all you want to do is write an installer, go and do that now. You don't really need the rest of this description unless you are interested in the details. .SH "How it Works" .IX Header "How it Works" The motivation behind \fBModule::Install\fR is that distributions need to interact with a large number of different versions of perl and module installers infrastructure, primarily CPAN.pm, CPANPLUS.pm, ExtUtils::MakeMaker and Module::Build. .PP These have accumulated \fBgreatly\fR varying feature and bug profiles over the years, and it is now very difficult to write an installer that will work properly using only the installed versions of these modules, .PP For example, the CPAN.pm version shipped with Perl 5.005 is now 5+ years old and considered highly buggy, yet it still exists on quite a number of legacy machines. .PP Rather than try to target one specific installer and/or make you add twisty workaround expressions to every piece of install code you write, \&\fBModule::Install\fR will copy part of itself into each module distribution it creates. .PP This allows new improvements to be used in your installers regardless of the age of the system a distribution is being installed on, at the cost of a small increase in the size of your distribution. .SS History .IX Subsection "History" This module was originally written by Brian Ingerson as a smart drop-in replacement for ExtUtils::MakeMaker. .PP For more information, see Brian's \fICreating Module Distributions with Module::Install\fR in June 2003 issue of The Perl Journal () .PP For a \fBlot\fR more information, and some personal opinions on the module and its creation, see Module::Install::Philosophy. .SH "COMMON COMMANDS" .IX Header "COMMON COMMANDS" The following are the most common commands generally used in installers. .PP It is far from an exhaustive list, as many of the plugins provide commands to work in more details that you would normally need. .SS name .IX Subsection "name" .Vb 1 \& name \*(AqMy\-Module\*(Aq; .Ve .PP The \fBname\fR command is compulsory command, generally the first. .PP It provides the name of your distribution, which for a module like \&\fBYour::Module\fR would normally be \f(CW\*(C`Your\-Module\*(C'\fR. .PP This naming scheme is not hard and fast and you should note that distributions are actually a separate naming scheme from modules. .PP For example the LWP modules come in a distribution called \&\f(CW\*(C`libwww\-perl\*(C'\fR. .SS all_from .IX Subsection "all_from" .Vb 1 \& all_from \*(Aqlib/My/Module.pm\*(Aq; .Ve .PP For most simple Perl distributions that feature one dominant module or class as the base, you can get the most Do What I Mean functionality by using the \fBall_from\fR command, which will try to extract as much metadata as possible from the Perl code and POD in that primary module. .PP Functionally, \f(CW\*(C`all_from\*(C'\fR is equivalent to \f(CW\*(C`abstract_from\*(C'\fR + \&\f(CW\*(C`author_from\*(C'\fR + \f(CW\*(C`version_from\*(C'\fR + \f(CW\*(C`license_from\*(C'\fR + \&\f(CW\*(C`perl_version_from\*(C'\fR. See below for details. .PP If any of these values are set already \fBbefore\fR \f(CW\*(C`all_from\*(C'\fR is used, they will kept and \fBnot\fR be overwritten. .SS abstract .IX Subsection "abstract" .Vb 1 \& abstract \*(AqThis distribution does something\*(Aq; .Ve .PP All distributions have an abstract, a short description of the distribution as a whole. It is usually around 30\-70 characters long. .PP The \f(CW\*(C`abstract\*(C'\fR command is used to explicitly set the abstract for the distribution, at least as far as the metadata file for the distribution is concerned. .SS abstract_from .IX Subsection "abstract_from" .Vb 1 \& abstract_from \*(Aqlib/My/Module.pm\*(Aq; .Ve .PP The \f(CW\*(C`abstract_from\*(C'\fR command retrieves the abstract from a particular file contained in the distribution package. Most often this is done from the main module, where \f(CW\*(C`Module::Install\*(C'\fR will read the POD and use whatever is in the \f(CW\*(C`=head1 NAME\*(C'\fR section (with module name stripped if needed) .PP \&\f(CW\*(C`abstract_from\*(C'\fR is set as part of \f(CW\*(C`all_from\*(C'\fR. .SS author .IX Subsection "author" .Vb 1 \& author \*(AqAdam Kennedy \*(Aq; .Ve .PP The distribution metadata contains information on the primary author or the distribution, or the primary maintainer if the original author is no longer involved. It should generally be specified in the form of an email address. .PP It you don't want to give away a real email address, you should use the \f(CW\*(C`CPANID@cpan.org\*(C'\fR address you receive automatically when you got your PAUSE account. .PP The \f(CW\*(C`author\*(C'\fR command is used to explicitly set this value. .SS author_from .IX Subsection "author_from" .Vb 1 \& author_from \*(Aqlib/My/Module.pm\*(Aq; .Ve .PP The \f(CW\*(C`author_from\*(C'\fR command retrieves the author from a particular file contained in the distribution package. Most often this is done using the main module, where Module::Install will read the POD and use whatever it can find in the \f(CW\*(C`=head1 AUTHOR\*(C'\fR section. .SS version .IX Subsection "version" .Vb 1 \& version \*(Aq0.01\*(Aq; .Ve .PP The \f(CW\*(C`version\*(C'\fR command is used to specify the version of the distribution, as distinct from the version of any single module within the distribution. .PP Of course, in almost all cases you want it to match the version of the primary module within the distribution, which you can do using \&\f(CW\*(C`version_from\*(C'\fR. .SS version_from .IX Subsection "version_from" .Vb 1 \& version_from \*(Aqlib/My/Module.pm\*(Aq; .Ve .PP The \f(CW\*(C`version_from\*(C'\fR command retrieves the distribution version from a particular file contained in the distribution package. Most often this is done from the main module. .PP \&\f(CW\*(C`version_from\*(C'\fR will look for the first time you set \f(CW$VERSION\fR and use the same value, using a technique consistent with various other module version scanning tools. .SS license .IX Subsection "license" .Vb 1 \& license \*(Aqperl\*(Aq; .Ve .PP The \f(CW\*(C`license\*(C'\fR command specifies the license for the distribution. .PP Most often this value will be \f(CW\*(Aqperl\*(Aq\fR, meaning \fI"the same as for Perl itself"\fR. Other allowed values include \f(CW\*(Aqgpl\*(Aq\fR, \f(CW\*(Aqlgpl\*(Aq\fR, \f(CW\*(Aqbsd\*(Aq\fR, \&\f(CW\*(AqMIT\*(Aq\fR, and \f(CW\*(Aqartistic\*(Aq\fR. .PP This value is always considered a summary, and it is normal for authors to include a \fILICENSE\fR file in the distribution, containing the full license for the distribution. .PP You are also reminded that if the distribution is intended to be uploaded to the CPAN, it \fBmust\fR be an OSI-approved open source license. Commercial software is not permitted on the CPAN. .SS license_from .IX Subsection "license_from" .Vb 1 \& license_from \*(Aqlib/My/Module.pm\*(Aq; .Ve .PP The \f(CW\*(C`license_from\*(C'\fR command retrieves the distribution license from a particular file contained in the distribution package. Most often this is done from the main module. .PP \&\f(CW\*(C`license_from\*(C'\fR will look inside the POD within the indicated file for a licensing or copyright-related section and scan for a variety of strings that identify the general class of license. .PP At this time it supports only the 6 values mentioned above in the \&\f(CW\*(C`license\*(C'\fR command summary. .SS perl_version .IX Subsection "perl_version" .Vb 1 \& perl_version \*(Aq5.006\*(Aq; .Ve .PP The \f(CW\*(C`perl_version\*(C'\fR command is used to specify the minimum version of the perl interpreter your distribution requires. .PP When specifying the version, you should try to use the normalized version string. Perl version segments are 3 digits long, so a dependency on Perl 5.6 will become \f(CW\*(Aq5.006\*(Aq\fR and Perl 5.10.2 will become \f(CW\*(Aq5.010002\*(Aq\fR. .SS perl_version_from .IX Subsection "perl_version_from" .Vb 1 \& perl_version_from \*(Aqlib/My/Module.pm\*(Aq .Ve .PP The \f(CW\*(C`perl_version_from\*(C'\fR command retrieves the minimum \fIperl\fR interpreter version from a particular file contained in the distribution package. Most often this is done from the main module. .PP The minimum version is detected by scanning the file for \f(CW\*(C`use 5.xxx\*(C'\fR pragma calls in the module file. .SS recommends .IX Subsection "recommends" .Vb 1 \& recommends \*(AqText::CSV_XS\*(Aq => \*(Aq0.50\*(Aq .Ve .PP The \f(CW\*(C`recommends\*(C'\fR command indicates an optional run-time module that provides extra functionality. Recommended dependencies are not needed to build or test your distribution, but are considered "nice to have". .PP As with "requires", the dependency is on a \fBmodule\fR and not a distribution. A version of zero indicates that any version of the module is recommended. .SS requires .IX Subsection "requires" .Vb 2 \& requires \*(AqList::Util\*(Aq => 0; \& requires \*(AqLWP\*(Aq => \*(Aq5.69\*(Aq; .Ve .PP The \f(CW\*(C`requires\*(C'\fR command indicates a normal run-time dependency of your distribution on another module. Most distributions will have one or more of these commands, indicating which CPAN (or otherwise) modules your distribution needs. .PP A \f(CW\*(C`requires\*(C'\fR dependency can be verbalised as \fI"If you wish to install and use this distribution, you must first install these modules first"\fR. .PP Note that the dependency is on a \fBmodule\fR and not a distribution. This is to ensure that your dependency stays correct, even if the module is moved or merged into a different distribution, as is occasionally the case. .PP A dependency on version zero indicates \fBany\fR version of module is sufficient. Versions should generally be quoted for clarity. .SS test_requires .IX Subsection "test_requires" .Vb 1 \& test_requires \*(AqTest::More\*(Aq => \*(Aq0.47\*(Aq; .Ve .PP The \f(CW\*(C`test_requires\*(C'\fR command indicates a test script dependency for the distribution. The specification format is identical to that of the \f(CW\*(C`requires\*(C'\fR command. .PP The \f(CW\*(C`test_requires\*(C'\fR command is distinct from the \f(CW\*(C`requires\*(C'\fR command in that it indicates a module that is needed \fBonly\fR during the testing of the distribution (often a period of only a few seconds) but will \fBnot\fR be needed after the distribution is installed. .PP The \f(CW\*(C`testrequires\*(C'\fR command is used to allow the installer some flexibility in how it provides the module, and to allow downstream packagers (Debian, FreeBSD, ActivePerl etc) to retain only the dependencies needed for run-time operation. .PP The \f(CW\*(C`include\*(C'\fR command is sometimes used by some authors along with \&\f(CW\*(C`test_requires\*(C'\fR to bundle a small well-tested module into the distribution package itself rather than inflict yet another module installation on users installing from CPAN directly. .SS configure_requires .IX Subsection "configure_requires" .Vb 1 \& configure_requires \*(AqFile::Spec\*(Aq => \*(Aq0.80\*(Aq; .Ve .PP The \f(CW\*(C`configure_requires\*(C'\fR command indicates a configure-time dependency for the distribution. The specification format is identical to that of the \f(CW\*(C`requires\*(C'\fR command. .PP The \f(CW\*(C`configure_requires\*(C'\fR command is used to get around the conundrum of how to use a CPAN module in your Makefile.PL, when you have to load Makefile.PL (and thus the CPAN module) in order to know that you need it. .PP Traditionally, this circular logic could not be broken and so Makefile.PL scripts needed to rely on lowest-common-denominator approaches, or to bundle those dependencies using something like the \f(CW\*(C`include\*(C'\fR command. .PP The \f(CW\*(C`configure_requires\*(C'\fR command creates an entry in the special configure_requires: key in the distribution's \fIMETA.yml\fR file. .PP Although most of \fIMETA.yml\fR is considered advisory only, a CPAN client will treat the contents of configure_requires: as authoritative, and install the listed modules \fBbefore\fR it executes the \fIMakefile.PL\fR (from which it then determines the other dependencies). .PP Please note that support for configure_requires: in CPAN clients is not 100% complete at time of writing, and still cannot be relied upon. .PP Because \fBModule::Install\fR itself only supports 5.005, it will silently add the equivalent of a \f(CW\*(C`configure_requires( perl => \*(Aq5.005\*(Aq );\*(C'\fR command to your distribution. .SS requires_external_bin .IX Subsection "requires_external_bin" .Vb 1 \& requires_external_bin \*(Aqcvs\*(Aq; .Ve .PP As part of its role as the dominant "glue" language, a lot of Perl modules run commands or programs on the host system. .PP The \f(CW\*(C`requires_external_bin\*(C'\fR command is used to verify that a particular command is available on the host system. .PP Unlike a missing Perl module, a missing external binary is unresolvable at make-time, and so the \fIMakefile.PL\fR run will abort with a "NA" (Not Applicable) result. .PP In future, this command will also add additional information to the metadata for the dist, so that auto-packagers for particular operating system are more-easily able to auto-discover the appropriate non-Perl packages needed as a dependency. .SS install_script .IX Subsection "install_script" .Vb 2 \& # The following are equivalent \& install_script \*(Aqscript/scriptname\*(Aq .Ve .PP The \f(CW\*(C`install_script\*(C'\fR command provides support for the installation of scripts that will become available at the console on both Unix and Windows (in the later case by wrapping it up as a .bat file). .PP Note that is it normal practice to \fBnot\fR put a .pl on the end of such scripts, so that they feel more natural when being used. .PP In the example above, the \fIscript/scriptname\fR program could be run after the installation just by doing the following. .PP .Vb 2 \& > scriptname \& Running scriptname 0.01... \& \& > .Ve .PP By convention, scripts should be placed in a /script directory within your distribution. To support less typing, if a script is located in the script directory, you need refer to it by name only. .PP .Vb 3 \& # The following are equivalent \& install_script \*(Aqfoo\*(Aq; \& install_script \*(Aqscript/foo\*(Aq; .Ve .SS no_index .IX Subsection "no_index" .Vb 2 \& no_index directory => \*(Aqexamples\*(Aq; \& no_index package => \*(AqDB\*(Aq; .Ve .PP Quite often a distribution will provide example scripts or testing modules (.pm files) as well as the actual library modules. .PP In almost all situations, you do \fBnot\fR want these indexed in the CPAN index, the master Perl packages list, or displayed on or websites, you just want them along for the ride. .PP The \f(CW\*(C`no_index\*(C'\fR command is used to indicate directories or files where there might be non-library .pm files or other files that the CPAN indexer and websites such as or should explicitly ignore. .PP The most common situation is to ignore example or demo directories, but a variety of different situations may require a \f(CW\*(C`no_index\*(C'\fR entry. .PP Another common use for \f(CW\*(C`no_index\*(C'\fR is to prevent the PAUSE indexer complaining when your module makes changes inside a "package DB" block. This is used to interact with the debugger in some specific ways. .PP See the \fIMETA.yml\fR documentation for more details on what \f(CW\*(C`no_index\*(C'\fR values are allowed. .PP The \fIinc\fR, \fIt\fR and \fIshare\fR (if \f(CW\*(C`install_share\*(C'\fR is used) directories are automatically \f(CW\*(C`no_index\*(C'\fR'ed for you if found and do not require an explicit command. .PP To summarize, if you can see it on or and you shouldn't be able to, you need a \f(CW\*(C`no_index\*(C'\fR entry to remove it. .SS "installdirs, install_as_*" .IX Subsection "installdirs, install_as_*" .Vb 1 \& installdirs \*(Aqsite\*(Aq; # the default \& \& install_as_core; # alias for installdirs \*(Aqperl\*(Aq \& install_as_cpan; # alias for installdirs \*(Aqsite\*(Aq \& install_as_site; # alias for installdirs \*(Aqsite\*(Aq \& install_as_vendor; # alias for installdirs \*(Aqvendor\*(Aq .Ve .PP The \f(CW\*(C`installdirs\*(C'\fR and \f(CW\*(C`install_as\*(C'\fR commands specify the location where the module should be installed; this is the equivalent to ExtUtils::MakeMaker's \f(CW\*(C`INSTALLDIRS\*(C'\fR option. For almost all regular modules, the default is recommended, and need not be changed. Dual-life (core and CPAN) modules, as well as vendor-specific modules, may need to use the other options. .PP If unsure, do not use this option. .SS WriteAll .IX Subsection "WriteAll" The \f(CW\*(C`WriteAll\*(C'\fR command is generally the last command in the file; it writes out \fIMETA.yml\fR and \fIMakefile\fR so the user can run the \&\f(CW\*(C`make\*(C'\fR, \f(CW\*(C`make test\*(C'\fR, \f(CW\*(C`make install\*(C'\fR install sequence. .SH EXTENSIONS .IX Header "EXTENSIONS" All extensions belong to the \fBModule::Install::*\fR namespace, and inherit from \fBModule::Install::Base\fR. There are three categories of extensions: .SS "Standard Extensions" .IX Subsection "Standard Extensions" Methods defined by a standard extension may be called as plain functions inside \fIMakefile.PL\fR; a corresponding singleton object will be spawned automatically. Other extensions may also invoke its methods just like their own methods: .PP .Vb 2 \& # delegates to $other_extension_obj\->method_name(@args) \& $self\->method_name(@args); .Ve .PP At the first time an extension's method is invoked, a POD-stripped version of it will be included under the \fIinc/Module/Install/\fR directory, and becomes \fIfixed\fR \-\- i.e., even if the user had installed a different version of the same extension, the included one will still be used instead. .PP If the author wish to upgrade extensions in \fIinc/\fR with installed ones, simply run \f(CW\*(C`perl Makefile.PL\*(C'\fR again; \fBModule::Install\fR determines whether you are an author by the existence of the \fIinc/.author/\fR directory. End-users can reinitialize everything and become the author by typing \f(CW\*(C`make realclean\*(C'\fR and \f(CW\*(C`perl Makefile.PL\*(C'\fR. .SS "Private Extensions" .IX Subsection "Private Extensions" Those extensions take the form of \fBModule::Install::PRIVATE\fR and \&\fBModule::Install::PRIVATE::*\fR. .PP Authors are encouraged to put all existing \fIMakefile.PL\fR magics into such extensions (e.g. \fIModule::Install::PRIVATE\fR for common bits; \&\fIModule::Install::PRIVATE::DISTNAME\fR for functions specific to a distribution). .PP Private extensions should not to be released on CPAN; simply put them somewhere in your \f(CW@INC\fR, under the \f(CW\*(C`Module/Install/\*(C'\fR directory, and start using their functions in \fIMakefile.PL\fR. Like standard extensions, they will never be installed on the end-user's machine, and therefore never conflict with other people's private extensions. .SS "Administrative Extensions" .IX Subsection "Administrative Extensions" Extensions under the \fBModule::Install::Admin::*\fR namespace are never included with the distribution. Their methods are not directly accessible from \fIMakefile.PL\fR or other extensions; they are invoked like this: .PP .Vb 2 \& # delegates to $other_admin_extension_obj\->method_name(@args) \& $self\->admin\->method_name(@args); .Ve .PP These methods only take effect during the \fIinitialization\fR run, when \&\fIinc/\fR is being populated; they are ignored for end-users. Again, to re-initialize everything, just run \f(CW\*(C`perl Makefile.PL\*(C'\fR as the author. .PP Scripts (usually one-liners in \fIMakefile\fR) that wish to dispatch \&\fBAUTOLOAD\fR functions into administrative extensions (instead of standard extensions) should use the \fBModule::Install::Admin\fR module directly. See Module::Install::Admin for details. .SH EXTENSIONS .IX Header "EXTENSIONS" Detailed information is provided for all (some) of the relevant modules via their own POD documentation. .SS Module::Install::AutoInstall .IX Subsection "Module::Install::AutoInstall" Provides \f(CWauto_install()\fR to automatically fetch and install prerequisites. .SS Module::Install::Base .IX Subsection "Module::Install::Base" The base class for all extensions .SS Module::Install::Bundle .IX Subsection "Module::Install::Bundle" Provides the \f(CW\*(C`bundle\*(C'\fR family of commands, allowing you to bundle another CPAN distribution within your distribution. .SS Module::Install::Fetch .IX Subsection "Module::Install::Fetch" Handles install-time fetching of files from remote servers via FTP and HTTP. .SS Module::Install::Include .IX Subsection "Module::Install::Include" Provides the \f(CW\*(C`include\*(C'\fR family of commands for embedding modules that are only need at build-time in your distribution and won't be installed. .SS Module::Install::Inline .IX Subsection "Module::Install::Inline" Provides \f(CW\*(C`&Inline\->write\*(C'\fR to replace \fBInline::MakeMaker\fR's functionality for making \fBInline\fR\-based modules (and cleaning up). .PP However, you should invoke this with \f(CW\*(C`WriteAll( inline => 1 )\*(C'\fR. .SS Module::Install::Makefile .IX Subsection "Module::Install::Makefile" Provides \f(CW\*(C`&Makefile\->write\*(C'\fR to generate a \fIMakefile\fR for you distribution. .SS Module::Install::Metadata .IX Subsection "Module::Install::Metadata" Provides \f(CW\*(C`&Meta\->write\*(C'\fR to generate a \fIMETA.yml\fR file for your distribution. .SS Module::Install::PAR .IX Subsection "Module::Install::PAR" Makes pre-compiled module binary packages from the built \fIblib\fR directory, and download existing ones to save recompiling. .SS Module::Install::Run .IX Subsection "Module::Install::Run" Determines if commands are available on the user's machine, and runs them via \fBIPC::Run3\fR. .SS Module::Install::Scripts .IX Subsection "Module::Install::Scripts" Handles packaging and installation of scripts to various bin dirs. .SS Module::Install::Win32 .IX Subsection "Module::Install::Win32" Functions for installing modules on Win32 and finding/installing \&\fInmake.exe\fR for users that need it. .SS Module::Install::WriteAll .IX Subsection "Module::Install::WriteAll" Provides the \f(CW\*(C`WriteAll\*(C'\fR, which writes all the requires files, such as \fIMETA.yml\fR and \fIMakefile\fR. .PP \&\f(CW\*(C`WriteAll\*(C'\fR takes four optional named parameters: .ie n .IP """check_nmake"" (defaults to true)" 4 .el .IP "\f(CWcheck_nmake\fR (defaults to true)" 4 .IX Item "check_nmake (defaults to true)" If true, invokes functions with the same name. .Sp \&\fIThe use of this param is no longer recommended.\fR .ie n .IP """inline"" (defaults to false)" 4 .el .IP "\f(CWinline\fR (defaults to false)" 4 .IX Item "inline (defaults to false)" If true, invokes \f(CW\*(C`&Inline\->write\*(C'\fR Inline modules. .ie n .IP """meta"" (defaults to true)" 4 .el .IP "\f(CWmeta\fR (defaults to true)" 4 .IX Item "meta (defaults to true)" If true, writes a \f(CW\*(C`META.yml\*(C'\fR file. .ie n .IP """sign"" (defaults to false)" 4 .el .IP "\f(CWsign\fR (defaults to false)" 4 .IX Item "sign (defaults to false)" If true, invokes \f(CW\*(C`sign\*(C'\fR command to digitally sign erm... something. .SS Module::Install::Admin::Find .IX Subsection "Module::Install::Admin::Find" Package-time functions for finding extensions, installed packages and files in subdirectories. .SS Module::Install::Admin::Manifest .IX Subsection "Module::Install::Admin::Manifest" Package-time functions for manipulating and updating the \&\fIMANIFEST\fR file. .SS Module::Install::Admin::Metadata .IX Subsection "Module::Install::Admin::Metadata" Package-time functions for manipulating and updating the \&\fIMETA.yml\fR file. .SS Module::Install::Admin::ScanDeps .IX Subsection "Module::Install::Admin::ScanDeps" Package-time scanning for non-core dependencies via \fBModule::ScanDeps\fR and \fBModule::CoreList\fR. .SH FAQ .IX Header "FAQ" .SS "What are the benefits of using \fBModule::Install\fP?" .IX Subsection "What are the benefits of using Module::Install?" Here is a brief overview of the reasons: .IP \(bu 4 Extremely easy for beginners to learn .IP \(bu 4 Does everything ExtUtils::MakeMaker does. .IP \(bu 4 Does it with a dramatically simpler syntax. .IP \(bu 4 Automatically scans for metadata for you. .IP \(bu 4 Requires no installation for end-users. .IP \(bu 4 Guaranteed forward-compatibility. .IP \(bu 4 Automatically updates your MANIFEST. .IP \(bu 4 Distributing scripts is easy. .IP \(bu 4 Include prerequisite modules (less dependencies to install) .IP \(bu 4 Auto-installation of prerequisites. .IP \(bu 4 Support for Inline\-based modules. .IP \(bu 4 Support for File::ShareDir shared data files .IP \(bu 4 Support for precompiled PAR binaries. .IP \(bu 4 Deals with Win32 install issues for you. .PP By greatly shrinking and simplifying the syntax, \fBModule::Install\fR keeps the amount of work required to maintain your \fIMakefile.PL\fR files to an absolute minimum. .PP And if you maintain more than one module than needs to do unusual installation tricks, you can create a specific module to abstract away this complexity. .SS "Module::Install isn't at 1.00 yet, is it safe to use yet?" .IX Subsection "Module::Install isn't at 1.00 yet, is it safe to use yet?" As long as you are going to periodically do incremental releases to get any bug fixes and new functionality, yes. .PP If you don't plan to do incremental releases, it might be a good idea to continue to wait for a while. .SH "COOKBOOK / EXAMPLES" .IX Header "COOKBOOK / EXAMPLES" The following are some real-life examples of \fIMakefile.PL\fR files using \fBModule::Install\fR. .SS Method::Alias .IX Subsection "Method::Alias" Method::Alias is a trivially-small utility module, with almost the smallest possible \fIMakefile.PL\fR. .PP .Vb 1 \& use inc::Module::Install; \& \& name \*(AqMethod\-Alias\*(Aq; \& all_from \*(Aqlib/Method/Alias.pm\*(Aq; \& test_requires \*(AqTest::More\*(Aq => \*(Aq0.42\*(Aq; .Ve .SS File::HomeDir .IX Subsection "File::HomeDir" File::HomeDir locates your home directory on any platform. It needs an installer that can handle different dependencies on different platforms. .PP .Vb 1 \& use inc::Module::Install; \& \& name \*(AqFile\-HomeDir\*(Aq; \& all_from \*(Aqlib/File/HomeDir.pm\*(Aq; \& requires \*(AqFile::Spec\*(Aq => \*(Aq0.80\*(Aq; \& test_requires \*(AqTest::More\*(Aq => \*(Aq0.47\*(Aq; \& \& if ( $MacPerl::Version ) { \& # Needed on legacy Mac OS 9 \& requires \*(AqMac::Files\*(Aq => 0; \& } \& \& if ( $^O eq \*(AqMXWin32\*(Aq ) { \& # Needed on Windows platforms \& requires \*(AqWin32::TieRegistry\*(Aq => 0; \& } \& \& WriteAll; .Ve .SH "TO DO" .IX Header "TO DO" Implement Module::Install::Compiled and Module::Install::Admin::Compiled to integrate the Module::Compiled "perl 6 to perl 5" functionality with Module::Install. Because this would add SIGNIFICANT dependencies (i.e. pugs!) this should almost certainly be distributed as a separate distribution. .PP Go over POD docs in detail. .PP Test recursive Makefile directories .PP The test suite needs a great deal more test scripts. .PP Dependencies on shared libraries (libxml/libxml.dll etc) and binary files so that debian/Win32/etc autopackaging applications can create the appropriate package-level dependencies there. .PP EU::MM 6.06_03+ supports META.yml natively. Maybe probe for that? .SH "SEE ALSO" .IX Header "SEE ALSO" Module::Install::Philosophy .PP inc::Module::Install .PP Module::Install::AutoInstall .PP Module::Install::Base .PP Module::Install::Bundle .PP Module::Install::MakeMaker .PP Module::Install::Share .PP Module::Install::Admin .PP Module::Install::Admin::Include .PP Module::Install::Admin::Manifest .PP CPAN::MakeMaker, Inline::MakeMaker .PP ExtUtils::MakeMaker .SH SUPPORT .IX Header "SUPPORT" Bugs should be reported via the CPAN bug tracker at .PP .PP For other issues, contact the (topmost) author. .SH AUTHORS .IX Header "AUTHORS" Adam Kennedy .PP Audrey Tang .PP Brian Ingerson .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2002 \- 2012 Brian Ingerson, Audrey Tang and Adam Kennedy. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.