home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / Install-Cookbook.pod < prev    next >
Encoding:
Text File  |  2004-01-01  |  3.0 KB  |  126 lines

  1. # $File: //depot/cpan/Module-Install/lib/Module/Install-Cookbook.pod $ $Author: autrijus $
  2. # $Revision: #4 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
  3.  
  4. =head1 NAME
  5.  
  6. Module::Install-Cookbook - A CornucopiE<aelig> of Module::Install Recipes
  7.  
  8. =head1 DESCRIPTION
  9.  
  10. It's a lot easier for most of us to cook a meal from a recipe, rather
  11. than just throwing things into a pot until something edible forms.  So
  12. it is with programming as well.  B<Module::Install> makes writing Perl
  13. module installers as easy as possible.  Having a set of easy to
  14. understand samples, makes it simpler yet.
  15.  
  16. This Cookbook is intended to be an ever-growing repository of small yet
  17. complete coding examples; each showing how to accomplish a particular
  18. task with B<Module::Install>.  Each example is followed by a short
  19. discussion, explaining in detail the particular features that are being
  20. demonstrated.
  21.  
  22. Guten Appetit!
  23.  
  24. =head1 Appetizers
  25.  
  26. =head2 Replacing C<ExtUtils::MakeMaker>
  27.  
  28. =over 4
  29.  
  30. =item Problem
  31.  
  32. As a CPAN author, you are likely to have some B<ExtUtils::MakeMaker>
  33. based F<Makefile.PL> already.  You want to take advantage of cool
  34. features offered by B<Module::Install> extensions, but why fix something
  35. that's not broken?
  36.  
  37. =item Solution
  38.  
  39. The I<fix> turns out to be extremely simple.  Where you had:
  40.  
  41.     use ExtUtils::MakeMaker;
  42.     WriteMakefile( NAME => "Foo::Bar" );
  43.  
  44. Now just write:
  45.  
  46.     use inc::Module::Install;
  47.     WriteMakefile( NAME => "Foo::Bar" );
  48.  
  49. Presto!  Your F<Makefile.PL> is now ready to receive all sort of magic
  50. extensions; see below for details.
  51.  
  52. =back
  53.  
  54. =over 4
  55.  
  56. =item Problem
  57.  
  58. XXX F<Build.PL>
  59.  
  60. =item Solution
  61.  
  62. =back
  63.  
  64.  
  65. =head1 Fast Food
  66.  
  67. XXX: to be written
  68.  
  69. =head1 The Main Course
  70.  
  71. =item Problem
  72.  
  73. Installing XS extensions from CPAN was difficult.  Some platforms do
  74. not come with a compiler (Win32, MacOSX...); some headers or libraries
  75. may be missing.
  76.  
  77. =item Solution
  78.  
  79. Just use the C<par_base> and C<fetch_par> functions:
  80.  
  81.     # same old Makefile.PL, with a few changes
  82.     use inc::Module::Install;            # was "use ExtUtils::MakeMaker;"
  83.     WriteMakefile( ... );        # same as the original
  84.     check_nmake();            # make sure the user have nmake
  85.     par_base('AUTRIJUS');        # your CPAN ID or a URL
  86.     fetch_par() unless can_cc();    # use precompiled PAR only if necessary
  87.  
  88. Users will not notice anything, except now it works.  Of course, you
  89. still need to type C<make par> and upload the precompiled package.
  90.  
  91. =head1 Just Desserts
  92.  
  93. XXX: to be written
  94.  
  95. =head1 Entertaining Guests
  96.  
  97. XXX: to be written
  98.  
  99. =head1 Food for Thought
  100.  
  101. XXX: to be written
  102.  
  103. =head1 SEE ALSO
  104.  
  105. For generic information, see L<Module::Install>.
  106.  
  107. =head1 AUTHOR
  108.  
  109. Autrijus Tang E<lt>autrijus@autrijus.orgE<gt>
  110.  
  111. Structure based on L<Inline::C-Cookbook> by Brian Ingerson
  112. E<lt>INGY@cpan.orgE<gt>
  113.  
  114. =head1 COPYRIGHT
  115.  
  116. Copyright 2003, 2004 by Autrijus Tang E<lt>autrijus@autrijus.orgE<gt>.
  117.  
  118. Copyright 2002 by Brian Ingerson E<lt>INGY@cpan.orgE<gt>.
  119.  
  120. This document is free documentation; you can redistribute it and/or
  121. modify it under the same terms as Perl itself.
  122.  
  123. See L<http://www.perl.com/perl/misc/Artistic.html>
  124.  
  125. =cut
  126.