3 # This module doesn't do much of anything itself, it inherits from the
4 # modules that do the real work. The only real thing it has to do is
5 # figure out which OS-specific module to pull in. Many of the
6 # OS-specific modules don't do anything either - most of the work is
7 # done in Module::Build::Base.
12 use File::Basename ();
14 use Module::Build::Base;
16 use vars qw($VERSION @ISA);
17 @ISA = qw(Module::Build::Base);
19 $VERSION = eval $VERSION;
21 # Okay, this is the brute-force method of finding out what kind of
22 # platform we're on. I don't know of a systematic way. These values
23 # came from the latest (bleadperl) perlport.pod.
66 # Inserts the given module into the @ISA hierarchy between
67 # Module::Build and its immediate parent
68 sub _interpose_module {
69 my ($self, $mod) = @_;
75 while (@{"${top_class}::ISA"}) {
76 last if ${"${top_class}::ISA"}[0] eq $ISA[0];
77 $top_class = ${"${top_class}::ISA"}[0];
80 @{"${top_class}::ISA"} = @ISA;
84 if (grep {-e File::Spec->catfile($_, qw(Module Build Platform), $^O) . '.pm'} @INC) {
85 __PACKAGE__->_interpose_module("Module::Build::Platform::$^O");
87 } elsif (exists $OSTYPES{$^O}) {
88 __PACKAGE__->_interpose_module("Module::Build::Platform::$OSTYPES{$^O}");
91 warn "Unknown OS type '$^O' - using default settings\n";
94 sub os_type { $OSTYPES{$^O} }
103 Module::Build - Build and install Perl modules
108 Standard process for building & installing modules:
115 Or, if you're on a platform (like DOS or Windows) that doesn't require
116 the "./" notation, you can do this:
126 C<Module::Build> is a system for building, testing, and installing
127 Perl modules. It is meant to be an alternative to
128 C<ExtUtils::MakeMaker>. Developers may alter the behavior of the
129 module through subclassing in a much more straightforward way than
130 with C<MakeMaker>. It also does not require a C<make> on your system
131 - most of the C<Module::Build> code is pure-perl and written in a very
132 cross-platform way. In fact, you don't even need a shell, so even
133 platforms like MacOS (traditional) can use it fairly easily. Its only
134 prerequisites are modules that are included with perl 5.6.0, and it
135 works fine on perl 5.005 if you can install a few additional modules.
137 See L<"MOTIVATIONS"> for more comparisons between C<ExtUtils::MakeMaker>
138 and C<Module::Build>.
140 To install C<Module::Build>, and any other module that uses
141 C<Module::Build> for its installation process, do the following:
143 perl Build.PL # 'Build.PL' script creates the 'Build' script
144 ./Build # Need ./ to ensure we're using this "Build" script
145 ./Build test # and not another one that happens to be in the PATH
148 This illustrates initial configuration and the running of three
149 'actions'. In this case the actions run are 'build' (the default
150 action), 'test', and 'install'. Other actions defined so far include:
158 distcheck prereq_report
159 distclean pure_install
169 You can run the 'help' action for a complete list of actions.
172 =head1 GUIDE TO DOCUMENTATION
174 The documentation for C<Module::Build> is broken up into three sections:
178 =item General Usage (L<Module::Build>)
180 This is the document you are currently reading. It describes basic
181 usage and background information. Its main purpose is to assist the
182 user who wants to learn how to invoke and control C<Module::Build>
183 scripts at the command line.
185 =item Authoring Reference (L<Module::Build::Authoring>)
187 This document describes the C<Module::Build> API for authors who are
188 writing F<Build.PL> scripts for a distribution or controlling
189 C<Module::Build> processes programmatically. It describes the
190 methods available as well as providing general information on
191 subclassing C<Module::Build> to alter and extend its behavior. Also,
192 there is a section on controlling the Build process from other
193 scripts, including how to construct an object and how to invoke
194 actions through it from an external script.
196 =item Cookbook (L<Module::Build::Cookbook>)
198 This document demonstrates how to accomplish many common tasks. It
199 covers general command line usage and authoring of F<Build.PL>
200 scripts. Includes working examples.
207 There are some general principles at work here. First, each task when
208 building a module is called an "action". These actions are listed
209 above; they correspond to the building, testing, installing,
210 packaging, etc., tasks.
212 Second, arguments are processed in a very systematic way. Arguments
213 are always key=value pairs. They may be specified at C<perl Build.PL>
214 time (i.e. C<perl Build.PL destdir=/my/secret/place>), in which case
215 their values last for the lifetime of the C<Build> script. They may
216 also be specified when executing a particular action (i.e.
217 C<Build test verbose=1>), in which case their values last only for the
218 lifetime of that command. Per-action command line parameters take
219 precedence over parameters specified at C<perl Build.PL> time.
221 The build process also relies heavily on the C<Config.pm> module, and
222 all the key=value pairs in C<Config.pm> are available in
224 C<< $self->{config} >>. If the user wishes to override any of the
225 values in C<Config.pm>, she may specify them like so:
227 perl Build.PL --config cc=gcc --config ld=gcc
229 The following build actions are provided by default.
235 If you run the C<Build> script without any arguments, it runs the
236 C<build> action, which in turn runs the C<code> and C<docs> actions.
238 This is analogous to the MakeMaker 'make all' target.
242 This action will clean up any files that the build process may have
243 created, including the C<blib/> directory (but not including the
244 C<_build/> directory and the C<Build> script itself).
248 This action builds your codebase.
250 By default it just creates a C<blib/> directory and copies any C<.pm>
251 and C<.pod> files from your C<lib/> directory into the C<blib/>
252 directory. It also compiles any C<.xs> files from C<lib/> and places
253 them in C<blib/>. Of course, you need a working C compiler (probably
254 the same one that built perl itself) for the compilation to work
257 The C<code> action also runs any C<.PL> files in your F<lib/>
258 directory. Typically these create other files, named the same but
259 without the C<.PL> ending. For example, a file F<lib/Foo/Bar.pm.PL>
260 could create the file F<lib/Foo/Bar.pm>. The C<.PL> files are
261 processed first, so any C<.pm> files (or other kinds that we deal
262 with) will get copied correctly.
270 This action will compare the files about to be installed with their
271 installed counterparts. For .pm and .pod files, a diff will be shown
272 (this currently requires a 'diff' program to be in your PATH). For
273 other files like compiled binary files, we simply report whether they
276 A C<flags> parameter may be passed to the action, which will be passed
277 to the 'diff' program. Consult your 'diff' documentation for the
278 parameters it will accept - a good one is C<-u>:
280 ./Build diff flags=-u
284 This action is helpful for module authors who want to package up their
285 module for source distribution through a medium like CPAN. It will create a
286 tarball of the files listed in F<MANIFEST> and compress the tarball using
289 By default, this action will use the external C<tar> and C<gzip>
290 executables on Unix-like platforms, and the C<Archive::Tar> module
291 elsewhere. However, you can force it to use whatever executable you
292 want by supplying an explicit C<tar> (and optional C<gzip>) parameter:
294 ./Build dist --tar C:\path\to\tar.exe --gzip C:\path\to\zip.exe
298 Reports which files are in the build directory but not in the
299 F<MANIFEST> file, and vice versa. (See L<manifest> for details.)
303 Performs the 'realclean' action and then the 'distcheck' action.
307 Creates a "distribution directory" named C<$dist_name-$dist_version>
308 (if that directory already exists, it will be removed first), then
309 copies all the files listed in the F<MANIFEST> file to that directory.
310 This directory is what the distribution tarball is created from.
314 Creates the F<META.yml> file that describes the distribution.
316 F<META.yml> is a file containing various bits of "metadata" about the
317 distribution. The metadata includes the distribution name, version,
318 abstract, prerequisites, license, and various other data about the
319 distribution. This file is created as F<META.yml> in YAML format, so
320 the C<YAML> module must be installed in order to create it. The
321 F<META.yml> file must also be listed in F<MANIFEST> - if it's not, a
322 warning will be issued.
324 The current version of the F<META.yml> specification can be found at
325 L<http://module-build.sourceforge.net/META-spec-v1.2.html>
329 Uses C<Module::Signature> to create a SIGNATURE file for your
330 distribution, and adds the SIGNATURE file to the distribution's
335 Performs the 'distdir' action, then switches into that directory and
336 runs a C<perl Build.PL>, followed by the 'build' and 'test' actions in
341 This will generate documentation (e.g. Unix man pages and html
342 documents) for any installable items under B<blib/> that
343 contain POD. If there are no C<bindoc> or C<libdoc> installation
344 targets defined (as will be the case on systems that don't support
345 Unix manpages) no action is taken for manpages. If there are no
346 C<binhtml> or C<libhtml> installation targets defined no action is
347 taken for html documents.
351 This is just like the C<install> action, but it won't actually do
352 anything, it will just report what it I<would> have done if you had
353 actually run the C<install> action.
357 This action will simply print out a message that is meant to help you
358 use the build process. It will show you a list of available build
361 With an optional argument specifying an action name (e.g. C<Build help
362 test>), the 'help' action will show you any POD documentation it can
363 find for that action.
367 This will generate HTML documentation for any binary or library files
368 under B<blib/> that contain POD. The HTML documentation will only be
369 installed if the install paths can be determined from values in
370 C<Config.pm>. You can also supply or override install paths on the
371 command line by specifying C<install_path> values for the C<binhtml>
372 and/or C<libhtml> installation targets.
376 This action will use C<ExtUtils::Install> to install the files from
377 C<blib/> into the system. See L<INSTALL PATHS>
378 for details about how Module::Build determines where to install
379 things, and how to influence this process.
381 If you want the installation process to look around in C<@INC> for
382 other versions of the stuff you're installing and try to delete it,
383 you can use the C<uninst> parameter, which tells C<ExtUtils::Install> to
386 ./Build install uninst=1
388 This can be a good idea, as it helps prevent multiple versions of a
389 module from being present on your system, which can be a confusing
394 This is an action intended for use by module authors, not people
395 installing modules. It will bring the F<MANIFEST> up to date with the
396 files currently present in the distribution. You may use a
397 F<MANIFEST.SKIP> file to exclude certain files or directories from
398 inclusion in the F<MANIFEST>. F<MANIFEST.SKIP> should contain a bunch
399 of regular expressions, one per line. If a file in the distribution
400 directory matches any of the regular expressions, it won't be included
403 The following is a reasonable F<MANIFEST.SKIP> starting point, you can
404 add your own stuff to it:
414 See the L<distcheck> and L<skipcheck> actions if you want to find out
415 what the C<manifest> action would do, without actually doing anything.
419 This will generate man pages for any binary or library files under
420 B<blib/> that contain POD. The man pages will only be installed if the
421 install paths can be determined from values in C<Config.pm>. You can
422 also supply or override install paths by specifying there values on
423 the command line with the C<bindoc> and C<libdoc> installation
428 Build a PPD file for your distribution.
430 This action takes an optional argument C<codebase> which is used in
431 the generated ppd file to specify the (usually relative) URL of the
432 distribution. By default, this value is the distribution name without
433 any path information.
437 ./Build ppd --codebase "MSWin32-x86-multi-thread/Module-Build-0.21.tar.gz"
441 Generates a PPM binary distribution and a PPD description file. This
442 action also invokes the 'ppd' action, so it can accept the same
443 C<codebase> argument described under that action.
445 This uses the same mechanism as the C<dist> action to tar & zip its
446 output, so you can supply C<tar> and/or C<gzip> parameters to affect
451 This action prints out a list of all prerequisites, the versions required, and
452 the versions actually installed. This can be useful for reviewing the
453 configuration of your system prior to a build, or when compiling data to send
458 This action is identical to the C<install> action. In the future,
459 though, if C<install> starts writing to the file file
460 F<$(INSTALLARCHLIB)/perllocal.pod>, C<pure_install> won't, and that
461 will be the only difference between them.
465 This action is just like the C<clean> action, but also removes the
466 C<_build> directory and the C<Build> script. If you run the
467 C<realclean> action, you are essentially starting over, so you will
468 have to re-create the C<Build> script again.
472 Reports which files are skipped due to the entries in the
473 F<MANIFEST.SKIP> file (See L<manifest> for details)
477 This will use C<Test::Harness> to run any regression tests and report
478 their results. Tests can be defined in the standard places: a file
479 called C<test.pl> in the top-level directory, or several files ending
480 with C<.t> in a C<t/> directory.
482 If you want tests to be 'verbose', i.e. show details of test execution
483 rather than just summary information, pass the argument C<verbose=1>.
485 If you want to run tests under the perl debugger, pass the argument
488 In addition, if a file called C<visual.pl> exists in the top-level
489 directory, this file will be executed as a Perl script and its output
490 will be shown to the user. This is a good place to put speed tests or
491 other tests that don't use the C<Test::Harness> format for output.
493 To override the choice of tests to run, you may pass a C<test_files>
494 argument whose value is a whitespace-separated list of test scripts to
495 run. This is especially useful in development, when you only want to
496 run a single test to see whether you've squashed a certain bug yet:
498 ./Build test --test_files t/something_failing.t
500 You may also pass several C<test_files> arguments separately:
502 ./Build test --test_files t/one.t --test_files t/two.t
504 or use a C<glob()>-style pattern:
506 ./Build test --test_files 't/01-*.t'
510 Runs the C<test> action using C<Devel::Cover>, generating a
511 code-coverage report showing which parts of the code were actually
512 exercised during the tests.
514 To pass options to C<Devel::Cover>, set the C<$DEVEL_COVER_OPTIONS>
515 environment variable:
517 DEVEL_COVER_OPTIONS=-ignore,Build ./Build testcover
521 This is a synonym for the 'test' action with the C<debugger=1>
526 This checks all the files described in the C<docs> action and
527 produces C<Test::Harness>-style output. If you are a module author,
528 this is useful to run before creating a new release.
532 ** Note: since C<only.pm> is so new, and since we just recently added
533 support for it here too, this feature is to be considered
536 If you have the C<only.pm> module installed on your system, you can
537 use this action to install a module into the version-specific library
538 trees. This means that you can have several versions of the same
539 module installed and C<use> a specific one like this:
541 use only MyModule => 0.55;
543 To override the default installation libraries in C<only::config>,
544 specify the C<versionlib> parameter when you run the C<Build.PL> script:
546 perl Build.PL --versionlib /my/version/place/
548 To override which version the module is installed as, specify the
549 C<versionlib> parameter when you run the C<Build.PL> script:
551 perl Build.PL --version 0.50
553 See the C<only.pm> documentation for more information on
554 version-specific installs.
561 =head2 Command Line Options
563 The following options can be used during any invocation of C<Build.PL>
564 or the Build script, during any action. For information on other
565 options specific to an action, see the documentation for the
568 NOTE: There is some preliminary support for options to use the more
569 familiar long option style. Most options can be preceded with the
570 C<--> long option prefix, and the underscores changed to dashes
571 (e.g. --use-rcfile). Additionally, the argument to boolean options is
572 optional, and boolean options can be negated by prefixing them with
573 'no' or 'no-' (e.g. --noverbose or --no-verbose).
579 Suppress informative messages on output.
583 Load the F<~/.modulebuildrc> option file. This option can be set to
584 false to prevent the custom resource file from being loaded.
588 Display extra information about the Build on output.
593 =head2 Default Options File (F<.modulebuildrc>)
595 When Module::Build starts up, it will look for a file,
596 F<$ENV{HOME}/.modulebuildrc>. If the file exists, the options
597 specified there will be used as defaults, as if they were typed on the
598 command line. The defaults can be overridden by specifying new values
601 The action name must come at the beginning of the line, followed by any
602 amount of whitespace and then the options. Options are given the same
603 as they would be on the command line. They can be separated by any
604 amount of whitespace, including newlines, as long there is whitespace at
605 the beginning of each continued line. Anything following a hash mark (C<#>)
606 is considered a comment, and is stripped before parsing. If more than
607 one line begins with the same action name, those lines are merged into
610 Besides the regular actions, there are two special pseudo-actions: the
611 key C<*> (asterisk) denotes any global options that should be applied
612 to all actions, and the key 'Build_PL' specifies options to be applied
613 when you invoke C<perl Build.PL>.
615 * verbose=1 # global options
617 install --install_base /home/ken
618 --install_path html=/home/ken/docs/html
620 If you wish to locate your resource file in a different location, you
621 can set the environment variable 'MODULEBUILDRC' to the complete
622 absolute path of the file containing your options.
627 When you invoke Module::Build's C<build> action, it needs to figure
628 out where to install things. The nutshell version of how this works
629 is that default installation locations are determined from
630 F<Config.pm>, and they may be overridden by using the C<install_path>
631 parameter. An C<install_base> parameter lets you specify an
632 alternative installation root like F</home/foo>, and a C<destdir> lets
633 you specify a temporary installation directory like F</tmp/install> in
634 case you want to create bundled-up installable packages.
636 Natively, Module::Build provides default installation locations for
637 the following types of installable items:
643 Usually pure-Perl module files ending in F<.pm>.
647 "Architecture-dependent" module files, usually produced by compiling
648 XS, Inline, or similar code.
652 Programs written in pure Perl. In order to improve reuse, try to make
653 these as small as possible - put the code into modules whenever
658 "Architecture-dependent" executable programs, i.e. compiled C code or
659 something. Pretty rare to see this in a perl distribution, but it
664 Documentation for the stuff in C<script> and C<bin>. Usually
665 generated from the POD in those files. Under Unix, these are manual
666 pages belonging to the 'man1' category.
670 Documentation for the stuff in C<lib> and C<arch>. This is usually
671 generated from the POD in F<.pm> files. Under Unix, these are manual
672 pages belonging to the 'man3' category.
676 This is the same as C<bindoc> above, but applies to html documents.
680 This is the same as C<bindoc> above, but applies to html documents.
684 Four other parameters let you control various aspects of how
685 installation paths are determined:
691 The default destinations for these installable things come from
692 entries in your system's C<Config.pm>. You can select from three
693 different sets of default locations by setting the C<installdirs>
694 parameter as follows:
696 'installdirs' set to:
699 uses the following defaults from Config.pm:
701 lib => installprivlib installsitelib installvendorlib
702 arch => installarchlib installsitearch installvendorarch
703 script => installscript installsitebin installvendorbin
704 bin => installbin installsitebin installvendorbin
705 bindoc => installman1dir installsiteman1dir installvendorman1dir
706 libdoc => installman3dir installsiteman3dir installvendorman3dir
707 binhtml => installhtml1dir installsitehtml1dir installvendorhtml1dir [*]
708 libhtml => installhtml3dir installsitehtml3dir installvendorhtml3dir [*]
710 * Under some OS (eg. MSWin32) the destination for html documents is
711 determined by the C<Config.pm> entry C<installhtmldir>.
713 The default value of C<installdirs> is "site". If you're creating
714 vendor distributions of module packages, you may want to do something
717 perl Build.PL --installdirs vendor
721 ./Build install --installdirs vendor
723 If you're installing an updated version of a module that was included
724 with perl itself (i.e. a "core module"), then you may set
725 C<installdirs> to "core" to overwrite the module in its present
728 (Note that the 'script' line is different from MakeMaker -
729 unfortunately there's no such thing as "installsitescript" or
730 "installvendorscript" entry in C<Config.pm>, so we use the
731 "installsitebin" and "installvendorbin" entries to at least get the
732 general location right. In the future, if C<Config.pm> adds some more
733 appropriate entries, we'll start using those.)
737 Once the defaults have been set, you can override them.
739 On the command line, that would look like this:
741 perl Build.PL --install_path lib=/foo/lib --install_path arch=/foo/lib/arch
745 ./Build install --install_path lib=/foo/lib --install_path arch=/foo/lib/arch
749 You can also set the whole bunch of installation paths by supplying the
750 C<install_base> parameter to point to a directory on your system. For
751 instance, if you set C<install_base> to "/home/ken" on a Linux
752 system, you'll install as follows:
754 lib => /home/ken/lib/perl5
755 arch => /home/ken/lib/perl5/i386-linux
756 script => /home/ken/bin
758 bindoc => /home/ken/man/man1
759 libdoc => /home/ken/man/man3
760 binhtml => /home/ken/html
761 libhtml => /home/ken/html
763 Note that this is I<different> from how MakeMaker's C<PREFIX>
764 parameter works. See L</"Why PREFIX is not recommended"> for more
765 details. C<install_base> just gives you a default layout under the
766 directory you specify, which may have little to do with the
767 C<installdirs=site> layout.
769 The exact layout under the directory you specify may vary by system -
770 we try to do the "sensible" thing on each platform.
774 If you want to install everything into a temporary directory first
775 (for instance, if you want to create a directory tree that a package
776 manager like C<rpm> or C<dpkg> could create a package from), you can
777 use the C<destdir> parameter:
779 perl Build.PL --destdir /tmp/foo
783 ./Build install --destdir /tmp/foo
785 This will effectively install to "/tmp/foo/$sitelib",
786 "/tmp/foo/$sitearch", and the like, except that it will use
787 C<File::Spec> to make the pathnames work correctly on whatever
788 platform you're installing on.
792 =head2 About PREFIX Support
794 First, it is necessary to understand the original idea behind
795 C<PREFIX>. If, for example, the default installation locations for
796 your machine are F</usr/local/lib/perl5/5.8.5> for modules,
797 F</usr/local/bin> for executables, F</usr/local/man/man1> and
798 F</usr/local/man/man3> for manual pages, etc., then they all share the
799 same "prefix" F</usr/local>. MakeMaker's C<PREFIX> mechanism was
800 intended as a way to change an existing prefix that happened to occur
801 in all those paths - essentially a C<< s{/usr/local}{/foo/bar} >> for
804 However, the real world is more complicated than that. The C<PREFIX>
805 idea is fundamentally broken when your machine doesn't jibe with
806 C<PREFIX>'s worldview.
811 =item Why PREFIX is not recommended
817 Many systems have Perl configs that make little sense with PREFIX.
818 For example, OS X, where core modules go in
819 F</System/Library/Perl/...>, user-installed modules go in
820 F</Library/Perl/...>, and man pages go in F</usr/share/man/...>. The
821 PREFIX is thus set to F</>. Install L<Foo::Bar> on OS X with
822 C<PREFIX=/home/spurkis> and you get things like
823 F</home/spurkis/Library/Perl/5.8.1/Foo/Bar.pm> and
824 F</home/spurkis/usr/share/man/man3/Foo::Bar.3pm>. Not too pretty.
826 The problem is not limited to Unix-like platforms, either - on Windows
827 builds (e.g. ActiveState perl 5.8.0), we have user-installed modules
828 going in F<C:\Perl\site\lib>, user-installed executables going in
829 F<C:\Perl\bin>, and PREFIX=F<C:\Perl\site>. The prefix just doesn't
830 apply neatly to the executables.
834 The PREFIX logic is too complicated and hard to predict for the user.
835 It's hard to document what exactly is going to happen. You can't give
836 a user simple instructions like "run perl Makefile.PL PREFIX=~ and
837 then set PERL5LIB=~/lib/perl5".
841 The results from PREFIX will change if your configuration of Perl
842 changes (for example, if you upgrade Perl). This means your modules
843 will end up in different places.
847 The results from PREFIX can change with different releases of
848 MakeMaker. The logic of PREFIX is subtle and it has been altered in
849 the past (mostly to limit damage in the many "edge cases" when its
850 behavior was undesirable).
854 PREFIX imposes decisions made by the person who configured Perl onto
855 the person installing a module. The person who configured Perl could
856 have been you or it could have been some guy at Redhat.
861 =item Alternatives to PREFIX
863 Module::Build offers L</install_base> as a simple, predictable, and
864 user-configurable alternative to ExtUtils::MakeMaker's C<PREFIX>.
865 What's more, MakeMaker will soon accept C<INSTALL_BASE> -- we strongly
866 urge you to make the switch.
868 Here's a quick comparison of the two when installing modules to your
869 home directory on a unix box:
873 % perl Makefile.PL PREFIX=/home/spurkis
874 PERL5LIB=/home/spurkis/lib/perl5/5.8.5:/home/spurkis/lib/perl5/site_perl/5.8.5
875 PATH=/home/spurkis/bin
876 MANPATH=/home/spurkis/man
880 % perl Build.PL install_base=/home/spurkis
881 PERL5LIB=/home/spurkis/lib/perl5
882 PATH=/home/spurkis/bin
883 MANPATH=/home/spurkis/man
885 [*] Note that MakeMaker's behaviour cannot be guaranteed in even this
886 common scenario, and differs among different versions of MakeMaker.
888 In short, using C<install_base> is similar to the following MakeMaker usage:
890 perl Makefile.PL PREFIX=/home/spurkis LIB=/home/spurkis/lib/perl5
892 See L</INSTALL PATHS> for details on other
893 installation options available and how to configure them.
900 There are several reasons I wanted to start over, and not just fix
901 what I didn't like about MakeMaker:
907 I don't like the core idea of MakeMaker, namely that C<make> should be
908 involved in the build process. Here are my reasons:
914 When a person is installing a Perl module, what can you assume about
915 their environment? Can you assume they have C<make>? No, but you can
916 assume they have some version of Perl.
920 When a person is writing a Perl module for intended distribution, can
921 you assume that they know how to build a Makefile, so they can
922 customize their build process? No, but you can assume they know Perl,
923 and could customize that way.
927 For years, these things have been a barrier to people getting the
928 build/install process to do what they want.
932 There are several architectural decisions in MakeMaker that make it
933 very difficult to customize its behavior. For instance, when using
934 MakeMaker you do C<use ExtUtils::MakeMaker>, but the object created in
935 C<WriteMakefile()> is actually blessed into a package name that's
936 created on the fly, so you can't simply subclass
937 C<ExtUtils::MakeMaker>. There is a workaround C<MY> package that lets
938 you override certain MakeMaker methods, but only certain explicitly
939 preselected (by MakeMaker) methods can be overridden. Also, the method
940 of customization is very crude: you have to modify a string containing
941 the Makefile text for the particular target. Since these strings
942 aren't documented, and I<can't> be documented (they take on different
943 values depending on the platform, version of perl, version of
944 MakeMaker, etc.), you have no guarantee that your modifications will
945 work on someone else's machine or after an upgrade of MakeMaker or
950 It is risky to make major changes to MakeMaker, since it does so many
951 things, is so important, and generally works. C<Module::Build> is an
952 entirely separate package so that I can work on it all I want, without
953 worrying about backward compatibility.
957 Finally, Perl is said to be a language for system administration.
958 Could it really be the case that Perl isn't up to the task of building
959 and installing software? Even if that software is a bunch of stupid
960 little C<.pm> files that just need to be copied from one place to
961 another? My sense was that we could design a system to accomplish
962 this in a flexible, extensible, and friendly manner. Or die trying.
969 The current method of relying on time stamps to determine whether a
970 derived file is out of date isn't likely to scale well, since it
971 requires tracing all dependencies backward, it runs into problems on
972 NFS, and it's just generally flimsy. It would be better to use an MD5
973 signature or the like, if available. See C<cons> for an example.
975 - append to perllocal.pod
976 - add a 'plugin' functionality
981 Ken Williams <kwilliams@cpan.org>
983 Development questions, bug reports, and patches should be sent to the
984 Module-Build mailing list at <module-build-general@lists.sourceforge.net>.
986 Bug reports are also welcome at
987 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build>.
989 An anonymous CVS repository containing the latest development version
990 is available; see <http://sourceforge.net/cvs/?group_id=45731> for the
991 details of how to access it.
996 Copyright (c) 2001-2005 Ken Williams. All rights reserved.
998 This library is free software; you can redistribute it and/or
999 modify it under the same terms as Perl itself.
1004 perl(1), Module::Build::Cookbook(3), Module::Build::Authoring(3),
1005 ExtUtils::MakeMaker(3), YAML(3)
1007 F<META.yml> Specification:
1008 L<http://module-build.sourceforge.net/META-spec-v1.2.html>
1010 L<http://www.dsmit.com/cons/>