Module-Install-1.06/0000755000175100017510000000000011723672002012661 5ustar adamadamModule-Install-1.06/Makefile.PL0000644000175100017510000000413711723671377014656 0ustar adamadam# Normally we don't need strict, but for this one we'll do it anyway. use strict; # Warnings need to be enabled this way, because Makefile.PL is not # an executable script (so we can't use a hashbang). BEGIN { $| = 1; $^W = 1; } # NOTE: Module::Install's Makefile.PL needs this "use lib 'lib'" to # bootstrap itself. Other module distributions using Module::Install # do not need it. It causes inc::Module::Install to load from the # (unique to this distribution) file ./lib/inc/Module/Install.pm instead # of the system inc::Module::Install or the bundled ./inc/Module/Install.pm use lib 'lib'; use inc::Module::Install; name 'Module-Install'; author 'Adam Kennedy '; perl_version '5.005'; all_from 'lib/Module/Install.pm'; requires 'Parse::CPAN::Meta' => '1.39'; requires 'File::Spec' => '3.28'; requires 'Devel::PPPort' => '3.16'; requires 'File::Remove' => '1.42'; requires 'YAML::Tiny' => '1.38'; requires 'JSON' => '2.14'; requires 'Module::ScanDeps' => '0.89'; requires 'Module::CoreList' => '2.17'; requires 'PAR::Dist' => '0.29'; requires 'Archive::Tar' => '1.44'; requires 'ExtUtils::Install' => '1.52'; requires 'ExtUtils::MakeMaker' => '6.59'; requires 'ExtUtils::ParseXS' => '2.19'; requires 'Module::Build' => '0.29'; requires 'LWP::UserAgent' => '5.812'; test_requires 'Test::Harness' => '3.13'; test_requires 'Test::More' => '0.86'; # Remove some extra test files clean_files( qw{ t/Foo } ); # Test configure_requires support (also needed by WriteMyMeta) configure_requires 'YAML::Tiny' => '1.33'; # Makes the recursive test script run # (to test recursive test support) tests_recursive; # This is a normal CPAN module install_as_cpan; # Normally this shouldn't be done in here, it should be done # by release automation. This is mostly for testing reasons. repository 'http://svn.ali.as/cpan/trunk/Module-Install'; # All of our dependencies are the same on all platforms dynamic_config 0; WriteAll; Module-Install-1.06/META.yml0000644000175100017510000000207211723671717014147 0ustar adamadam--- abstract: 'Standalone, extensible Perl module installer' author: - 'Adam Kennedy ' build_requires: ExtUtils::MakeMaker: 6.36 Test::Harness: 3.13 Test::More: 0.86 configure_requires: ExtUtils::MakeMaker: 6.36 YAML::Tiny: 1.33 distribution_type: module dynamic_config: 0 generated_by: 'Module::Install version 1.06' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Module-Install no_index: directory: - inc - t - xt requires: Archive::Tar: 1.44 Devel::PPPort: 3.16 ExtUtils::Install: 1.52 ExtUtils::MakeMaker: 6.59 ExtUtils::ParseXS: 2.19 File::Remove: 1.42 File::Spec: 3.28 JSON: 2.14 LWP::UserAgent: 5.812 Module::Build: 0.29 Module::CoreList: 2.17 Module::ScanDeps: 0.89 PAR::Dist: 0.29 Parse::CPAN::Meta: 1.39 YAML::Tiny: 1.38 perl: 5.005 resources: ChangeLog: http://fisheye2.atlassian.com/changelog/cpan/trunk/Module-Install license: http://dev.perl.org/licenses/ repository: http://svn.ali.as/cpan/trunk/Module-Install version: 1.06 Module-Install-1.06/LICENSE0000644000175100017510000005014011723671377013704 0ustar adamadam Terms of Perl itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" ---------------------------------------------------------------------------- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS ---------------------------------------------------------------------------- The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Module-Install-1.06/README0000644000175100017510000006332511723671377013570 0ustar adamadamNAME Module::Install - Standalone, extensible Perl module installer SYNOPSIS In your Makefile.PL: (Recommended Usage) use inc::Module::Install; # Define metadata name 'Your-Module'; all_from 'lib/Your/Module.pm'; # Specific dependencies requires 'File::Spec' => '0.80'; test_requires 'Test::More' => '0.42'; recommends 'Text::CSV_XS'=> '0.50'; no_index 'directory' => 'demos'; install_script 'myscript'; WriteAll; Quickly upgrade a legacy ExtUtil::MakeMaker installer: use inc::Module::Install; WriteMakefile( ... ); DESCRIPTION Module::Install 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. 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. 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 Makefile.PL. Then modify the file to suit your own particular case, using the list of commands documented in "COMMON COMMANDS" below. 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. How it Works The motivation behind Module::Install 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. These have accumulated greatly 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, 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. Rather than try to target one specific installer and/or make you add twisty workaround expressions to every piece of install code you write, Module::Install will copy part of itself into each module distribution it creates. 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. History This module was originally written by Brian Ingerson as a smart drop-in replacement for ExtUtils::MakeMaker. For more information, see Brian's *Creating Module Distributions with Module::Install* in June 2003 issue of The Perl Journal (). For a lot more information, and some personal opinions on the module and its creation, see Module::Install::Philosophy. COMMON COMMANDS The following are the most common commands generally used in installers. It is far from an exhaustive list, as many of the plugins provide commands to work in more details that you would normally need. name name 'My-Module'; The name command is compulsory command, generally the first. It provides the name of your distribution, which for a module like Your::Module would normally be "Your-Module". This naming scheme is not hard and fast and you should note that distributions are actually a separate naming scheme from modules. For example the LWP modules come in a distribution called "libwww-perl". all_from all_from 'lib/My/Module.pm'; 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 all_from command, which will try to extract as much metadata as possible from the Perl code and POD in that primary module. Functionally, "all_from" is equivalent to "abstract_from" + "author_from" + "version_from" + "license_from" + "perl_version_from". See below for details. If any of these values are set already before "all_from" is used, they will kept and not be overwritten. abstract abstract 'This distribution does something'; All distributions have an abstract, a short description of the distribution as a whole. It is usually around 30-70 characters long. The "abstract" command is used to explicitly set the abstract for the distribution, at least as far as the metadata file for the distribution is concerned. abstract_from abstract_from 'lib/My/Module.pm'; The "abstract_from" command retrieves the abstract from a particular file contained in the distribution package. Most often this is done from the main module, where "Module::Install" will read the POD and use whatever is in the "=head1 NAME" section (with module name stripped if needed) "abstract_from" is set as part of "all_from". author author 'Adam Kennedy '; 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. It you don't want to give away a real email address, you should use the "CPANID@cpan.org" address you receive automatically when you got your PAUSE account. The "author" command is used to explicitly set this value. author_from author_from 'lib/My/Module.pm'; The "author_from" 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 "=head1 AUTHOR" section. version version '0.01'; The "version" command is used to specify the version of the distribution, as distinct from the version of any single module within the distribution. 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 "version_from". version_from version_from 'lib/My/Module.pm'; The "version_from" command retrieves the distribution version from a particular file contained in the distribution package. Most often this is done from the main module. "version_from" will look for the first time you set $VERSION and use the same value, using a technique consistent with various other module version scanning tools. license license 'perl'; The "license" command specifies the license for the distribution. Most often this value will be 'perl', meaning *"the same as for Perl itself"*. Other allowed values include 'gpl', 'lgpl', 'bsd', 'MIT', and 'artistic'. This value is always considered a summary, and it is normal for authors to include a LICENSE file in the distribution, containing the full license for the distribution. You are also reminded that if the distribution is intended to be uploaded to the CPAN, it must be an OSI-approved open source license. Commercial software is not permitted on the CPAN. license_from license_from 'lib/My/Module.pm'; The "license_from" command retrieves the distribution license from a particular file contained in the distribution package. Most often this is done from the main module. "license_from" 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. At this time it supports only the 6 values mentioned above in the "license" command summary. perl_version perl_version '5.006'; The "perl_version" command is used to specify the minimum version of the perl interpreter your distribution requires. 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 '5.006' and Perl 5.10.2 will become '5.010002'. perl_version_from perl_version_from 'lib/My/Module.pm' The "perl_version_from" command retrieves the minimum perl interpreter version from a particular file contained in the distribution package. Most often this is done from the main module. The minimum version is detected by scanning the file for "use 5.xxx" pragma calls in the module file. recommends recommends 'Text::CSV_XS' => '0.50' The "recommends" 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". As with "requires", the dependency is on a module and not a distribution. A version of zero indicates that any version of the module is recommended. requires requires 'List::Util' => 0; requires 'LWP' => '5.69'; The "requires" 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. A "requires" dependency can be verbalised as *"If you wish to install and use this distribution, you must first install these modules first"*. Note that the dependency is on a module and not a distribution. This is to ensure that your dependency stays correct, even if the module is moved or merged into a different distribtion, as is occasionally the case. A dependency on version zero indicates any version of module is sufficient. Versions should generally be quoted for clarity. test_requires test_requires 'Test::More' => '0.47'; The "test_requires" command indicates a test script dependency for the distribution. The specification format is identical to that of the "requires" command. The "test_requires" command is distinct from the "requires" command in that it indicates a module that is needed only during the testing of the distribution (often a period of only a few seconds) but will not be needed after the distribution is installed. The "testrequires" 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. The "include" command is sometimes used by some authors along with "test_requires" 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. configure_requires configure_requires 'File::Spec' => '0.80'; The "configure_requires" command indicates a configure-time dependency for the distribution. The specification format is identical to that of the "requires" command. The "configure_requires" 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. 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 "include" command. The "configure_requires" command creates an entry in the special configure_requires: key in the distribution's META.yml file. Although most of META.yml is considered advisory only, a CPAN client will treat the contents of configure_requires: as authorative, and install the listed modules before it executes the Makefile.PL (from which it then determines the other dependencies). Please note that support for configure_requires: in CPAN clients is not 100% complete at time of writing, and still cannot be relied upon. Because Module::Install itself only supports 5.005, it will silently add the equivalent of a "configure_requires( perl => '5.005' );" command to your distribution. requires_external_bin requires_external_bin 'cvs'; As part of its role as the dominant "glue" language, a lot of Perl modules run commands or programs on the host system. The "requires_external_bin" command is used to verify that a particular command is available on the host system. Unlike a missing Perl module, a missing external binary is unresolvable at make-time, and so the Makefile.PL run will abort with a "NA" (Not Applicable) result. 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. install_script # The following are equivalent install_script 'script/scriptname' The "install_script" 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). Note that is it normal practice to not put a .pl on the end of such scripts, so that they feel more natural when being used. In the example above, the script/scriptname program could be run after the installation just by doing the following. > scriptname Running scriptname 0.01... > 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. # The following are equivalent install_script 'foo'; install_script 'script/foo'; no_index no_index directory => 'examples'; no_index package => 'DB'; Quite often a distrubition will provide example scripts or testing modules (.pm files) as well as the actual library modules. In almost all situations, you do not want these indexed in the CPAN index, the master Perl packages list, or displayed on the website, you just want them along for the ride. The "no_index" 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 should explicitly ignore. The most common situation is to ignore example or demo directories, but a variety of different situations may require a "no_index" entry. Another common use for "no_index" 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. See the META.yml documentation for more details on what "no_index" values are allowed. The inc, t and share (if "install_share" is used) directories are automatically "no_index"'ed for you if found and do not require an explicit command. To summarize, if you can see it on and you shouldn't be able to, you need a "no_index" entry to remove it. installdirs, install_as_* installdirs 'site'; # the default install_as_core; # alias for installdirs 'perl' install_as_cpan; # alias for installdirs 'site' install_as_site; # alias for installdirs 'site' install_as_vendor; # alias for installdirs 'vendor' The "installdirs" and "install_as" commands specify the location where the module should be installed; this is the equivalent to ExtUtils::MakeMaker's "INSTALLDIRS" 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. If unsure, do not use this option. WriteAll The "WriteAll" command is generally the last command in the file; it writes out META.yml and Makefile so the user can run the "make", "make test", "make install" install sequence. EXTENSIONS All extensions belong to the Module::Install::* namespace, and inherit from Module::Install::Base. There are three categories of extensions: Standard Extensions Methods defined by a standard extension may be called as plain functions inside Makefile.PL; a corresponding singleton object will be spawned automatically. Other extensions may also invoke its methods just like their own methods: # delegates to $other_extension_obj->method_name(@args) $self->method_name(@args); At the first time an extension's method is invoked, a POD-stripped version of it will be included under the inc/Module/Install/ directory, and becomes *fixed* -- i.e., even if the user had installed a different version of the same extension, the included one will still be used instead. If the author wish to upgrade extensions in inc/ with installed ones, simply run "perl Makefile.PL" again; Module::Install determines whether you are an author by the existence of the inc/.author/ directory. End-users can reinitialize everything and become the author by typing "make realclean" and "perl Makefile.PL". Private Extensions Those extensions take the form of Module::Install::PRIVATE and Module::Install::PRIVATE::*. Authors are encouraged to put all existing Makefile.PL magics into such extensions (e.g. Module::Install::PRIVATE for common bits; Module::Install::PRIVATE::DISTNAME for functions specific to a distribution). Private extensions should not to be released on CPAN; simply put them somewhere in your @INC, under the "Module/Install/" directory, and start using their functions in Makefile.PL. Like standard extensions, they will never be installed on the end-user's machine, and therefore never conflict with other people's private extensions. Administrative Extensions Extensions under the Module::Install::Admin::* namespace are never included with the distribution. Their methods are not directly accessible from Makefile.PL or other extensions; they are invoked like this: # delegates to $other_admin_extension_obj->method_name(@args) $self->admin->method_name(@args); These methods only take effect during the *initialization* run, when inc/ is being populated; they are ignored for end-users. Again, to re-initialize everything, just run "perl Makefile.PL" as the author. Scripts (usually one-liners in Makefile) that wish to dispatch AUTOLOAD functions into administrative extensions (instead of standard extensions) should use the Module::Install::Admin module directly. See Module::Install::Admin for details. EXTENSIONS Detailed information is provided for all (some) of the relevant modules via their own POD documentation. Module::Install::AutoInstall Provides "auto_install()" to automatically fetch and install prerequisites. Module::Install::Base The base class for all extensions Module::Install::Bundle Provides the "bundle" family of commands, allowing you to bundle another CPAN distribution within your distribution. Module::Install::Fetch Handles install-time fetching of files from remote servers via FTP and HTTP. Module::Install::Include Provides the "include" family of commands for embedding modules that are only need at build-time in your distribution and won't be installed. Module::Install::Inline Provides "&Inline->write" to replace Inline::MakeMaker's functionality for making Inline-based modules (and cleaning up). However, you should invoke this with "WriteAll( inline => 1 )". Module::Install::Makefile Provides "&Makefile->write" to generate a Makefile for you distribution. Module::Install::Metadata Provides "&Meta->write" to generate a META.yml file for your distribution. Module::Install::PAR Makes pre-compiled module binary packages from the built blib directory, and download existing ones to save recompiling. Module::Install::Run Determines if commands are available on the user's machine, and runs them via IPC::Run3. Module::Install::Scripts Handles packaging and installation of scripts to various bin dirs. Module::Install::Win32 Functions for installing modules on Win32 and finding/installing nmake.exe for users that need it. Module::Install::WriteAll Provides the "WriteAll", which writes all the requires files, such as META.yml and Makefile. "WriteAll" takes four optional named parameters: "check_nmake" (defaults to true) If true, invokes functions with the same name. *The use of this param is no longer recommended.* "inline" (defaults to false) If true, invokes "&Inline->write" Inline modules. "meta" (defaults to true) If true, writes a "META.yml" file. "sign" (defaults to false) If true, invokes "sign" command to digitally sign erm... something. Module::Install::Admin::Find Package-time functions for finding extensions, installed packages and files in subdirectories. Module::Install::Admin::Manifest Package-time functions for manipulating and updating the MANIFEST file. Module::Install::Admin::Metadata Package-time functions for manipulating and updating the META.yml file. Module::Install::Admin::ScanDeps Package-time scanning for non-core dependencies via Module::ScanDeps and Module::CoreList. FAQ What are the benefits of using Module::Install? Here is a brief overview of the reasons: * Extremely easy for beginners to learn * Does everything ExtUtils::MakeMaker does. * Does it with a dramatically simpler syntax. * Automatically scans for metadata for you. * Requires no installation for end-users. * Guaranteed forward-compatibility. * Automatically updates your MANIFEST. * Distributing scripts is easy. * Include prerequisite modules (less dependencies to install) * Auto-installation of prerequisites. * Support for Inline-based modules. * Support for File::ShareDir shared data files * Support for precompiled PAR binaries. * Deals with Win32 install issues for you. By greatly shrinking and simplifying the syntax, Module::Install keeps the amount of work required to maintain your Makefile.PL files to an absolute minimum. 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. 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. If you don't plan to do incremental releases, it might be a good idea to continue to wait for a while. COOKBOOK / EXAMPLES The following are some real-life examples of Makefile.PL files using Module::Install. Method::Alias Method::Alias is a trivially-small utility module, with almost the smallest possible Makefile.PL. use inc::Module::Install; name 'Method-Alias'; all_from 'lib/Method/Alias.pm'; test_requires 'Test::More' => '0.42'; File::HomeDir File::HomeDir locates your home directory on any platform. It needs an installer that can handle different dependencies on different platforms. use inc::Module::Install; name 'File-HomeDir'; all_from 'lib/File/HomeDir.pm'; requires 'File::Spec' => '0.80'; test_requires 'Test::More' => '0.47'; if ( $MacPerl::Version ) { # Needed on legacy Mac OS 9 requires 'Mac::Files' => 0; } if ( $^O eq 'MXWin32' ) { # Needed on Windows platforms requires 'Win32::TieRegistry' => 0; } WriteAll; 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. Go over POD docs in detail. Test recursive Makefile directories The test suite needs a great deal more test scripts. 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. EU::MM 6.06_03+ supports META.yml natively. Maybe probe for that? SEE ALSO Module::Install::Philosophy inc::Module::Install Module::Install::AutoInstall Module::Install::Base Module::Install::Bundle Module::Install::MakeMaker Module::Install::Share Module::Install::Admin Module::Install::Admin::Include Module::Install::Admin::Manifest CPAN::MakeMaker, Inline::MakeMaker ExtUtils::MakeMaker SUPPORT Bugs should be reported via the CPAN bug tracker at For other issues, contact the (topmost) author. AUTHORS Adam Kennedy Audrey Tang Brian Ingerson COPYRIGHT Copyright 2002 - 2011 Brian Ingerson, Audrey Tang and Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Module-Install-1.06/MYMETA.json0000644000175100017510000000356011723671720014562 0ustar adamadam{ "abstract" : "Standalone, extensible Perl module installer", "author" : [ "Adam Kennedy " ], "dynamic_config" : 0, "generated_by" : "Module::Install version 1.06, CPAN::Meta::Converter version 2.112621", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Module-Install", "no_index" : { "directory" : [ "inc", "t", "xt" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "6.36", "Test::Harness" : "3.13", "Test::More" : "0.86", "YAML::Tiny" : "1.33" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.36", "YAML::Tiny" : "1.33" } }, "runtime" : { "requires" : { "Archive::Tar" : "1.44", "Devel::PPPort" : "3.16", "ExtUtils::Install" : "1.52", "ExtUtils::MakeMaker" : "6.59", "ExtUtils::ParseXS" : "2.19", "File::Remove" : "1.42", "File::Spec" : "3.28", "JSON" : "2.14", "LWP::UserAgent" : "5.812", "Module::Build" : "0.29", "Module::CoreList" : "2.17", "Module::ScanDeps" : "0.89", "PAR::Dist" : "0.29", "Parse::CPAN::Meta" : "1.39", "YAML::Tiny" : "1.38", "perl" : "5.005" } } }, "release_status" : "stable", "resources" : { "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "url" : "http://svn.ali.as/cpan/trunk/Module-Install" }, "x_ChangeLog" : "http://fisheye2.atlassian.com/changelog/cpan/trunk/Module-Install" }, "version" : "1.06" } Module-Install-1.06/xt/0000755000175100017510000000000011723672002013314 5ustar adamadamModule-Install-1.06/xt/licenses.t0000644000175100017510000000144011723671377015323 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use Module::Install::Metadata; eval { require Software::License; require Module::Find; }; plan skip_all => "requires Software::License and Module::Find" if $@; my @licenses = Module::Find::findsubmod('Software::License'); plan tests => 1 * @licenses; foreach my $license (@licenses) { SKIP: { local $@; eval "require $license"; if ($@) { skip "Can't load $license: $@", 1; next; } my $name = $license->name; my $meta = $license->meta_name; unless ($meta) { skip "$license has no meta_name", 1; next; } $meta =~ s/_\d+$//; my $got = Module::Install::Metadata::__extract_license($name); ok $got =~ /^$meta/, $name; # should also test license urls? my $url = $license->url; } } Module-Install-1.06/xt/meta.t0000644000175100017510000000107311723671377014446 0ustar adamadam#!/usr/bin/perl # Test that our META.yml file matches the current specification. use strict; BEGIN { $| = 1; $^W = 1; } my $MODULE = 'Test::CPAN::Meta 0.17'; # Don't run tests for installs use Test::More; unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } # Load the testing module eval "use $MODULE"; if ( $@ ) { $ENV{RELEASE_TESTING} ? die( "Failed to load required release-testing module $MODULE" ) : plan( skip_all => "$MODULE not available for testing" ); } meta_yaml_ok(); Module-Install-1.06/xt/pmv.t0000644000175100017510000000125211723671377014321 0ustar adamadam#!/usr/bin/perl # Test that our declared minimum Perl version matches our syntax use strict; BEGIN { $| = 1; $^W = 1; } my @MODULES = ( 'Perl::MinimumVersion 1.27', 'Test::MinimumVersion 0.101080', ); # Don't run tests for installs use Test::More; unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } # Load the testing modules foreach my $MODULE ( @MODULES ) { eval "use $MODULE"; if ( $@ ) { $ENV{RELEASE_TESTING} ? die( "Failed to load required release-testing module $MODULE" ) : plan( skip_all => "$MODULE not available for testing" ); } } all_minimum_version_from_metayml_ok(); Module-Install-1.06/xt/pod.t0000644000175100017510000000116711723671377014306 0ustar adamadam#!/usr/bin/perl # Test that the syntax of our POD documentation is valid use strict; BEGIN { $| = 1; $^W = 1; } my @MODULES = ( 'Pod::Simple 3.14', 'Test::Pod 1.44', ); # Don't run tests for installs use Test::More; unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) { plan( skip_all => "Author tests not required for installation" ); } # Load the testing modules foreach my $MODULE ( @MODULES ) { eval "use $MODULE"; if ( $@ ) { $ENV{RELEASE_TESTING} ? die( "Failed to load required release-testing module $MODULE" ) : plan( skip_all => "$MODULE not available for testing" ); } } all_pod_files_ok(); Module-Install-1.06/inc/0000755000175100017510000000000011723672002013432 5ustar adamadamModule-Install-1.06/inc/Module/0000755000175100017510000000000011723672002014657 5ustar adamadamModule-Install-1.06/inc/Module/Install.pm0000644000175100017510000003013511723671716016640 0ustar adamadam#line 1 package Module::Install; # For any maintainers: # The load order for Module::Install is a bit magic. # It goes something like this... # # IF ( host has Module::Install installed, creating author mode ) { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install # 3. The installed version of inc::Module::Install loads # 4. inc::Module::Install calls "require Module::Install" # 5. The ./inc/ version of Module::Install loads # } ELSE { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install # 3. The ./inc/ version of Module::Install loads # } use 5.005; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); use vars qw{$VERSION $MAIN}; BEGIN { # All Module::Install core packages now require synchronised versions. # This will be used to ensure we don't accidentally load old or # different versions of modules. # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. $VERSION = '1.06'; # Storage for the pseudo-singleton $MAIN = undef; *inc::Module::Install::VERSION = *VERSION; @inc::Module::Install::ISA = __PACKAGE__; } sub import { my $class = shift; my $self = $class->new(@_); my $who = $self->_caller; #------------------------------------------------------------- # all of the following checks should be included in import(), # to allow "eval 'require Module::Install; 1' to test # installation of Module::Install. (RT #51267) #------------------------------------------------------------- # Whether or not inc::Module::Install is actually loaded, the # $INC{inc/Module/Install.pm} is what will still get set as long as # the caller loaded module this in the documented manner. # If not set, the caller may NOT have loaded the bundled version, and thus # they may not have a MI version that works with the Makefile.PL. This would # result in false errors or unexpected behaviour. And we don't want that. my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; unless ( $INC{$file} ) { die <<"END_DIE" } Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; END_DIE # This reportedly fixes a rare Win32 UTC file time issue, but # as this is a non-cross-platform XS module not in the core, # we shouldn't really depend on it. See RT #24194 for detail. # (Also, this module only supports Perl 5.6 and above). eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006; # If the script that is loading Module::Install is from the future, # then make will detect this and cause it to re-run over and over # again. This is bad. Rather than taking action to touch it (which # is unreliable on some platforms and requires write permissions) # for now we should catch this and refuse to run. if ( -f $0 ) { my $s = (stat($0))[9]; # If the modification time is only slightly in the future, # sleep briefly to remove the problem. my $a = $s - time; if ( $a > 0 and $a < 5 ) { sleep 5 } # Too far in the future, throw an error. my $t = time; if ( $s > $t ) { die <<"END_DIE" } Your installer $0 has a modification time in the future ($s > $t). This is known to create infinite loops in make. Please correct this, then run $0 again. END_DIE } # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. It was impossible to maintain duel backends, and has been deprecated. Please remove all Build.PL files and only use the Makefile.PL installer. END_DIE #------------------------------------------------------------- # To save some more typing in Module::Install installers, every... # use inc::Module::Install # ...also acts as an implicit use strict. $^H |= strict::bits(qw(refs subs vars)); #------------------------------------------------------------- unless ( -f $self->{file} ) { foreach my $key (keys %INC) { delete $INC{$key} if $key =~ /Module\/Install/; } local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{'inc/Module/Install.pm'}; delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; return 1; } sub autoload { my $self = shift; my $who = $self->_caller; my $cwd = Cwd::cwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = Cwd::cwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } unless ($$sym =~ s/([^:]+)$//) { # XXX: it looks like we can't retrieve the missing function # via $$sym (usually $main::AUTOLOAD) in this case. # I'm still wondering if we should slurp Makefile.PL to # get some context or not ... my ($package, $file, $line) = caller; die <<"EOT"; Unknown function is found at $file line $line. Execution of $file aborted due to runtime errors. If you're a contributor to a project, you may need to install some Module::Install extensions from CPAN (or other repository). If you're a user of a module, please contact the author. EOT } my $method = $1; if ( uc($method) eq $method ) { # Do nothing return; } elsif ( $method =~ /^_/ and $self->can($method) ) { # Dispatch to the root M:I class return $self->$method(@_); } # Dispatch to the appropriate plugin unshift @_, ( $self, $1 ); goto &{$self->can('call')}; }; } sub preload { my $self = shift; unless ( $self->{extensions} ) { $self->load_extensions( "$self->{prefix}/$self->{path}", $self ); } my @exts = @{$self->{extensions}}; unless ( @exts ) { @exts = $self->{admin}->load_all_extensions; } my %seen; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless $obj->can($method); next if $method =~ /^_/; next if $method eq uc($method); $seen{$method}++; } } my $who = $self->_caller; foreach my $name ( sort keys %seen ) { local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; delete $INC{'FindBin.pm'}; { # to suppress the redefine warning local $SIG{__WARN__} = sub {}; require FindBin; } # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ( $args{path} ) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; $args{wrote} = 0; bless( \%args, $class ); } sub call { my ($self, $method) = @_; my $obj = $self->load($method) or return; splice(@_, 0, 2, $obj); goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die <<"END_DIE"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END_DIE my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top) = @_; my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find( sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; return if lc($subpath) eq lc($self->{dispatch}); $file = "$self->{path}/$subpath.pm"; my $pkg = "$self->{name}::$subpath"; $pkg =~ s!/!::!g; # If we have a mixed-case package name, assume case has been preserved # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($subpath . '.pm'); my $in_pod = 0; foreach ( split //, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text next if /^\s*#/; # and comments if ( m/^\s*package\s+($pkg)\s*;/i ) { $pkg = $1; last; } } } push @found, [ $file, $pkg ]; }, $path ) if -d $path; @found; } ##################################################################### # Common Utility Functions sub _caller { my $depth = 0; my $call = caller($depth); while ( $call eq __PACKAGE__ ) { $depth++; $call = caller($depth); } return $call; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_NEW sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_OLD sub _readperl { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; return $string; } sub _readpod { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; return $string if $_[0] =~ /\.pod\z/; $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; $string =~ s/^\n+//s; return $string; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_NEW sub _write { local *FH; open( FH, "> $_[0]" ) or die "open($_[0]): $!"; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_OLD # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). sub _version ($) { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { # Normalise multipart versions $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; } $s =~ s/^(\d+)\.?//; my $l = $1 || 0; my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g; $l = $l . '.' . join '', @v if @v; return $l + 0; } sub _cmp ($$) { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS sub _CLASS ($) { ( defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s ) ? $_[0] : undef; } 1; # Copyright 2008 - 2012 Adam Kennedy. Module-Install-1.06/inc/Module/Install/0000755000175100017510000000000011723672002016265 5ustar adamadamModule-Install-1.06/inc/Module/Install/Can.pm0000644000175100017510000000615711723671717017351 0ustar adamadam#line 1 package Module::Install::Can; use strict; use Config (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # check if we can load some module ### Upgrade this to not have to load the module if possible sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= '.pm' unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # Check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; require File::Spec; my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # Can our C compiler environment build XS files sub can_xs { my $self = shift; # Ensure we have the CBuilder module $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); # Do we have the configure_requires checker? local $@; eval "require ExtUtils::CBuilder;"; if ( $@ ) { # They don't obey configure_requires, so it is # someone old and delicate. Try to avoid hurting # them by falling back to an older simpler test. return $self->can_cc(); } # Do we have a working C compiler my $builder = ExtUtils::CBuilder->new( quiet => 1, ); unless ( $builder->have_compiler ) { # No working C compiler return 0; } # Write a C file representative of what XS becomes require File::Temp; my ( $FH, $tmpfile ) = File::Temp::tempfile( "compilexs-XXXXX", SUFFIX => '.c', ); binmode $FH; print $FH <<'END_C'; #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int main(int argc, char **argv) { return 0; } int boot_sanexs() { return 1; } END_C close $FH; # Can the C compiler access the same headers XS does my @libs = (); my $object = undef; eval { local $^W = 0; $object = $builder->compile( source => $tmpfile, ); @libs = $builder->link( objects => $object, module_name => 'sanexs', ); }; my $result = $@ ? 0 : 1; # Clean up all the build files foreach ( $tmpfile, $object, @libs ) { next unless defined $_; 1 while unlink; } return $result; } # Can we locate a (the) C compiler sub can_cc { my $self = shift; my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ( $^O eq 'cygwin' ) { require ExtUtils::MM_Cygwin; require ExtUtils::MM_Win32; if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { ExtUtils::MM_Win32->maybe_command($file); } else { ExtUtils::MM_Unix->maybe_command($file); } } } } 1; __END__ #line 236 Module-Install-1.06/inc/Module/Install/Fetch.pm0000644000175100017510000000462711723671717017701 0ustar adamadam#line 1 package Module::Install::Fetch; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub get_file { my ($self, %args) = @_; my ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) { $args{url} = $args{ftp_url} or (warn("LWP support unavailable!\n"), return); ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; } $|++; print "Fetching '$file' from $host... "; unless (eval { require Socket; Socket::inet_aton($host) }) { warn "'$host' resolve failed!\n"; return; } return unless $scheme eq 'ftp' or $scheme eq 'http'; require Cwd; my $dir = Cwd::getcwd(); chdir $args{local_dir} or return if exists $args{local_dir}; if (eval { require LWP::Simple; 1 }) { LWP::Simple::mirror($args{url}, $file); } elsif (eval { require Net::FTP; 1 }) { eval { # use Net::FTP to get past firewall my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); $ftp->login("anonymous", 'anonymous@example.com'); $ftp->cwd($path); $ftp->binary; $ftp->get($file) or (warn("$!\n"), return); $ftp->quit; } } elsif (my $ftp = $self->can_run('ftp')) { eval { # no Net::FTP, fallback to ftp.exe require FileHandle; my $fh = FileHandle->new; local $SIG{CHLD} = 'IGNORE'; unless ($fh->open("|$ftp -n")) { warn "Couldn't open ftp: $!\n"; chdir $dir; return; } my @dialog = split(/\n/, <<"END_FTP"); open $host user anonymous anonymous\@example.com cd $path binary get $file $file quit END_FTP foreach (@dialog) { $fh->print("$_\n") } $fh->close; } } else { warn "No working 'ftp' program available!\n"; chdir $dir; return; } unless (-f $file) { warn "Fetching failed: $@\n"; chdir $dir; return; } return if exists $args{size} and -s $file != $args{size}; system($args{run}) if exists $args{run}; unlink($file) if $args{remove}; print(((!exists $args{check_for} or -e $args{check_for}) ? "done!" : "failed! ($!)"), "\n"); chdir $dir; return !$?; } 1; Module-Install-1.06/inc/Module/Install/Win32.pm0000644000175100017510000000340311723671717017541 0ustar adamadam#line 1 package Module::Install::Win32; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $^O eq 'MSWin32' and $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and ! $self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); die <<'END_MESSAGE' unless $rv; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- END_MESSAGE } 1; Module-Install-1.06/inc/Module/Install/WriteAll.pm0000644000175100017510000000237611723671717020372 0ustar adamadam#line 1 package Module::Install::WriteAll; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_, ); $self->sign(1) if $args{sign}; $self->admin->WriteAll(%args) if $self->is_admin; $self->check_nmake if $args{check_nmake}; unless ( $self->makemaker_args->{PL_FILES} ) { # XXX: This still may be a bit over-defensive... unless ($self->makemaker(6.25)) { $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL'; } } # Until ExtUtils::MakeMaker support MYMETA.yml, make sure # we clean it up properly ourself. $self->realclean_files('MYMETA.yml'); if ( $args{inline} ) { $self->Inline->write; } else { $self->Makefile->write; } # The Makefile write process adds a couple of dependencies, # so write the META.yml files after the Makefile. if ( $args{meta} ) { $self->Meta->write; } # Experimental support for MYMETA if ( $ENV{X_MYMETA} ) { if ( $ENV{X_MYMETA} eq 'JSON' ) { $self->Meta->write_mymeta_json; } else { $self->Meta->write_mymeta_yaml; } } return 1; } 1; Module-Install-1.06/inc/Module/Install/Metadata.pm0000644000175100017510000004327711723671717020374 0ustar adamadam#line 1 package Module::Install::Metadata; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } my @boolean_keys = qw{ sign }; my @scalar_keys = qw{ name module_name abstract version distribution_type tests installdirs }; my @tuple_keys = qw{ configure_requires build_requires requires recommends bundles resources }; my @resource_keys = qw{ homepage bugtracker repository }; my @array_keys = qw{ keywords author }; *authors = \&author; sub Meta { shift } sub Meta_BooleanKeys { @boolean_keys } sub Meta_ScalarKeys { @scalar_keys } sub Meta_TupleKeys { @tuple_keys } sub Meta_ResourceKeys { @resource_keys } sub Meta_ArrayKeys { @array_keys } foreach my $key ( @boolean_keys ) { *$key = sub { my $self = shift; if ( defined wantarray and not @_ ) { return $self->{values}->{$key}; } $self->{values}->{$key} = ( @_ ? $_[0] : 1 ); return $self; }; } foreach my $key ( @scalar_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} = shift; return $self; }; } foreach my $key ( @array_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} ||= []; push @{$self->{values}->{$key}}, @_; return $self; }; } foreach my $key ( @resource_keys ) { *$key = sub { my $self = shift; unless ( @_ ) { return () unless $self->{values}->{resources}; return map { $_->[1] } grep { $_->[0] eq $key } @{ $self->{values}->{resources} }; } return $self->{values}->{resources}->{$key} unless @_; my $uri = shift or die( "Did not provide a value to $key()" ); $self->resources( $key => $uri ); return 1; }; } foreach my $key ( grep { $_ ne "resources" } @tuple_keys) { *$key = sub { my $self = shift; return $self->{values}->{$key} unless @_; my @added; while ( @_ ) { my $module = shift or last; my $version = shift || 0; push @added, [ $module, $version ]; } push @{ $self->{values}->{$key} }, @added; return map {@$_} @added; }; } # Resource handling my %lc_resource = map { $_ => 1 } qw{ homepage license bugtracker repository }; sub resources { my $self = shift; while ( @_ ) { my $name = shift or last; my $value = shift or next; if ( $name eq lc $name and ! $lc_resource{$name} ) { die("Unsupported reserved lowercase resource '$name'"); } $self->{values}->{resources} ||= []; push @{ $self->{values}->{resources} }, [ $name, $value ]; } $self->{values}->{resources}; } # Aliases for build_requires that will have alternative # meanings in some future version of META.yml. sub test_requires { shift->build_requires(@_) } sub install_requires { shift->build_requires(@_) } # Aliases for installdirs options sub install_as_core { $_[0]->installdirs('perl') } sub install_as_cpan { $_[0]->installdirs('site') } sub install_as_site { $_[0]->installdirs('site') } sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { my $self = shift; my $value = @_ ? shift : 1; if ( $self->{values}->{dynamic_config} ) { # Once dynamic we never change to static, for safety return 0; } $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } # Convenience command sub static_config { shift->dynamic_config(0); } sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; my $version = shift or die( "Did not provide a value to perl_version()" ); # Normalize the version $version = $self->_perl_version($version); # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } $self->{values}->{perl_version} = $version; } sub all_from { my ( $self, $file ) = @_; unless ( defined($file) ) { my $name = $self->name or die( "all_from called with no args without setting name() first" ); $file = join('/', 'lib', split(/-/, $name)) . '.pm'; $file =~ s{.*/}{} unless -e $file; unless ( -e $file ) { die("all_from cannot find $file from $name"); } } unless ( -f $file ) { die("The path '$file' does not exist, or is not a file"); } $self->{values}{all_from} = $file; # Some methods pull from POD instead of code. # If there is a matching .pod, use that instead my $pod = $file; $pod =~ s/\.pm$/.pod/i; $pod = $file unless -e $pod; # Pull the different values $self->name_from($file) unless $self->name; $self->version_from($file) unless $self->version; $self->perl_version_from($file) unless $self->perl_version; $self->author_from($pod) unless @{$self->author || []}; $self->license_from($pod) unless $self->license; $self->abstract_from($pod) unless $self->abstract; return 1; } sub provides { my $self = shift; my $provides = ( $self->{values}->{provides} ||= {} ); %$provides = (%$provides, @_) if @_; return $provides; } sub auto_provides { my $self = shift; return $self unless $self->is_admin; unless (-e 'MANIFEST') { warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; return $self; } # Avoid spurious warnings as we are not checking manifest here. local $SIG{__WARN__} = sub {1}; require ExtUtils::Manifest; local *ExtUtils::Manifest::manicheck = sub { return }; require Module::Build; my $build = Module::Build->new( dist_name => $self->name, dist_version => $self->version, license => $self->license, ); $self->provides( %{ $build->find_dist_packages || {} } ); } sub feature { my $self = shift; my $name = shift; my $features = ( $self->{values}->{features} ||= [] ); my $mods; if ( @_ == 1 and ref( $_[0] ) ) { # The user used ->feature like ->features by passing in the second # argument as a reference. Accomodate for that. $mods = $_[0]; } else { $mods = \@_; } my $count = 0; push @$features, ( $name => [ map { ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ } @$mods ] ); return @$features; } sub features { my $self = shift; while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } return $self->{values}->{features} ? @{ $self->{values}->{features} } : (); } sub no_index { my $self = shift; my $type = shift; push @{ $self->{values}->{no_index}->{$type} }, @_ if $type; return $self->{values}->{no_index}; } sub read { my $self = shift; $self->include_deps( 'YAML::Tiny', 0 ); require YAML::Tiny; my $data = YAML::Tiny::LoadFile('META.yml'); # Call methods explicitly in case user has already set some values. while ( my ( $key, $value ) = each %$data ) { next unless $self->can($key); if ( ref $value eq 'HASH' ) { while ( my ( $module, $version ) = each %$value ) { $self->can($key)->($self, $module => $version ); } } else { $self->can($key)->($self, $value); } } return $self; } sub write { my $self = shift; return $self unless $self->is_admin; $self->admin->write_meta; return $self; } sub version_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->version( ExtUtils::MM_Unix->parse_version($file) ); # for version integrity check $self->makemaker_args( VERSION_FROM => $file ); } sub abstract_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->abstract( bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' )->parse_abstract($file) ); } # Add both distribution and module name sub name_from { my ($self, $file) = @_; if ( Module::Install::_read($file) =~ m/ ^ \s* package \s* ([\w:]+) \s* ; /ixms ) { my ($name, $module_name) = ($1, $1); $name =~ s{::}{-}g; $self->name($name); unless ( $self->module_name ) { $self->module_name($module_name); } } else { die("Cannot determine name from $file\n"); } } sub _extract_perl_version { if ( $_[0] =~ m/ ^\s* (?:use|require) \s* v? ([\d_\.]+) \s* ; /ixms ) { my $perl_version = $1; $perl_version =~ s{_}{}g; return $perl_version; } else { return; } } sub perl_version_from { my $self = shift; my $perl_version=_extract_perl_version(Module::Install::_read($_[0])); if ($perl_version) { $self->perl_version($perl_version); } else { warn "Cannot determine perl version info from $_[0]\n"; return; } } sub author_from { my $self = shift; my $content = Module::Install::_read($_[0]); if ($content =~ m/ =head \d \s+ (?:authors?)\b \s* ([^\n]*) | =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* ([^\n]*) /ixms) { my $author = $1 || $2; # XXX: ugly but should work anyway... if (eval "require Pod::Escapes; 1") { # Pod::Escapes has a mapping table. # It's in core of perl >= 5.9.3, and should be installed # as one of the Pod::Simple's prereqs, which is a prereq # of Pod::Text 3.x (see also below). $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $Pod::Escapes::Name2character_number{$1} ? chr($Pod::Escapes::Name2character_number{$1}) : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) { # Pod::Text < 3.0 has yet another mapping table, # though the table name of 2.x and 1.x are different. # (1.x is in core of Perl < 5.6, 2.x is in core of # Perl < 5.9.3) my $mapping = ($Pod::Text::VERSION < 2) ? \%Pod::Text::HTML_Escapes : \%Pod::Text::ESCAPES; $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $mapping->{$1} ? $mapping->{$1} : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } else { $author =~ s{E}{<}g; $author =~ s{E}{>}g; } $self->author($author); } else { warn "Cannot determine author info from $_[0]\n"; } } #Stolen from M::B my %license_urls = ( perl => 'http://dev.perl.org/licenses/', apache => 'http://apache.org/licenses/LICENSE-2.0', apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1', artistic => 'http://opensource.org/licenses/artistic-license.php', artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', lgpl => 'http://opensource.org/licenses/lgpl-license.php', lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', bsd => 'http://opensource.org/licenses/bsd-license.php', gpl => 'http://opensource.org/licenses/gpl-license.php', gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', mit => 'http://opensource.org/licenses/mit-license.php', mozilla => 'http://opensource.org/licenses/mozilla1.1.php', open_source => undef, unrestricted => undef, restrictive => undef, unknown => undef, ); sub license { my $self = shift; return $self->{values}->{license} unless @_; my $license = shift or die( 'Did not provide a value to license()' ); $license = __extract_license($license) || lc $license; $self->{values}->{license} = $license; # Automatically fill in license URLs if ( $license_urls{$license} ) { $self->resources( license => $license_urls{$license} ); } return 1; } sub _extract_license { my $pod = shift; my $matched; return __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?) (=head \d.*|=cut.*|)\z /xms ) || __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?) (=head \d.*|=cut.*|)\z /xms ); } sub __extract_license { my $license_text = shift or return; my @phrases = ( '(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1, '(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1, 'Artistic and GPL' => 'perl', 1, 'GNU general public license' => 'gpl', 1, 'GNU public license' => 'gpl', 1, 'GNU lesser general public license' => 'lgpl', 1, 'GNU lesser public license' => 'lgpl', 1, 'GNU library general public license' => 'lgpl', 1, 'GNU library public license' => 'lgpl', 1, 'GNU Free Documentation license' => 'unrestricted', 1, 'GNU Affero General Public License' => 'open_source', 1, '(?:Free)?BSD license' => 'bsd', 1, 'Artistic license 2\.0' => 'artistic_2', 1, 'Artistic license' => 'artistic', 1, 'Apache (?:Software )?license' => 'apache', 1, 'GPL' => 'gpl', 1, 'LGPL' => 'lgpl', 1, 'BSD' => 'bsd', 1, 'Artistic' => 'artistic', 1, 'MIT' => 'mit', 1, 'Mozilla Public License' => 'mozilla', 1, 'Q Public License' => 'open_source', 1, 'OpenSSL License' => 'unrestricted', 1, 'SSLeay License' => 'unrestricted', 1, 'zlib License' => 'open_source', 1, 'proprietary' => 'proprietary', 0, ); while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { $pattern =~ s#\s+#\\s+#gs; if ( $license_text =~ /\b$pattern\b/i ) { return $license; } } return ''; } sub license_from { my $self = shift; if (my $license=_extract_license(Module::Install::_read($_[0]))) { $self->license($license); } else { warn "Cannot determine license info from $_[0]\n"; return 'unknown'; } } sub _extract_bugtracker { my @links = $_[0] =~ m#L<( https?\Q://rt.cpan.org/\E[^>]+| https?\Q://github.com/\E[\w_]+/[\w_]+/issues| https?\Q://code.google.com/p/\E[\w_\-]+/issues/list )>#gx; my %links; @links{@links}=(); @links=keys %links; return @links; } sub bugtracker_from { my $self = shift; my $content = Module::Install::_read($_[0]); my @links = _extract_bugtracker($content); unless ( @links ) { warn "Cannot determine bugtracker info from $_[0]\n"; return 0; } if ( @links > 1 ) { warn "Found more than one bugtracker link in $_[0]\n"; return 0; } # Set the bugtracker bugtracker( $links[0] ); return 1; } sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->requires( $module => $version ); } } sub test_requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->test_requires( $module => $version ); } } # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to # numbers (eg, 5.006001 or 5.008009). # Also, convert double-part versions (eg, 5.8) sub _perl_version { my $v = $_[-1]; $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; $v =~ s/(\.\d\d\d)000$/$1/; $v =~ s/_.+$//; if ( ref($v) ) { # Numify $v = $v + 0; } return $v; } sub add_metadata { my $self = shift; my %hash = @_; for my $key (keys %hash) { warn "add_metadata: $key is not prefixed with 'x_'.\n" . "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/; $self->{values}->{$key} = $hash{$key}; } } ###################################################################### # MYMETA Support sub WriteMyMeta { die "WriteMyMeta has been deprecated"; } sub write_mymeta_yaml { my $self = shift; # We need YAML::Tiny to write the MYMETA.yml file unless ( eval { require YAML::Tiny; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.yml\n"; YAML::Tiny::DumpFile('MYMETA.yml', $meta); } sub write_mymeta_json { my $self = shift; # We need JSON to write the MYMETA.json file unless ( eval { require JSON; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.json\n"; Module::Install::_write( 'MYMETA.json', JSON->new->pretty(1)->canonical->encode($meta), ); } sub _write_mymeta_data { my $self = shift; # If there's no existing META.yml there is nothing we can do return undef unless -f 'META.yml'; # We need Parse::CPAN::Meta to load the file unless ( eval { require Parse::CPAN::Meta; 1; } ) { return undef; } # Merge the perl version into the dependencies my $val = $self->Meta->{values}; my $perl = delete $val->{perl_version}; if ( $perl ) { $val->{requires} ||= []; my $requires = $val->{requires}; # Canonize to three-dot version after Perl 5.6 if ( $perl >= 5.006 ) { $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e } unshift @$requires, [ perl => $perl ]; } # Load the advisory META.yml file my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; # Overwrite the non-configure dependency hashs delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; if ( exists $val->{requires} ) { $meta->{requires} = { map { @$_ } @{ $val->{requires} } }; } if ( exists $val->{build_requires} ) { $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } }; } return $meta; } 1; Module-Install-1.06/inc/Module/Install/Base.pm0000644000175100017510000000214711723671717017515 0ustar adamadam#line 1 package Module::Install::Base; use strict 'vars'; use vars qw{$VERSION}; BEGIN { $VERSION = '1.06'; } # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w }; } #line 42 sub new { my $class = shift; unless ( defined &{"${class}::call"} ) { *{"${class}::call"} = sub { shift->_top->call(@_) }; } unless ( defined &{"${class}::load"} ) { *{"${class}::load"} = sub { shift->_top->load(@_) }; } bless { @_ }, $class; } #line 61 sub AUTOLOAD { local $@; my $func = eval { shift->_top->autoload } or return; goto &$func; } #line 75 sub _top { $_[0]->{_top}; } #line 90 sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } #line 106 sub is_admin { ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin'); } sub DESTROY {} package Module::Install::Base::FakeAdmin; use vars qw{$VERSION}; BEGIN { $VERSION = $Module::Install::Base::VERSION; } my $fake; sub new { $fake ||= bless(\@_, $_[0]); } sub AUTOLOAD {} sub DESTROY {} # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->(); } 1; #line 159 Module-Install-1.06/inc/Module/Install/Makefile.pm0000644000175100017510000002743711723671717020371 0ustar adamadam#line 1 package Module::Install::Makefile; use strict 'vars'; use ExtUtils::MakeMaker (); use Module::Install::Base (); use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub Makefile { $_[0] } my %seen = (); sub prompt { shift; # Infinite loop protection my @c = caller(); if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; } # In automated testing or non-interactive session, always use defaults if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) { local $ENV{PERL_MM_USE_DEFAULT} = 1; goto &ExtUtils::MakeMaker::prompt; } else { goto &ExtUtils::MakeMaker::prompt; } } # Store a cleaned up version of the MakeMaker version, # since we need to behave differently in a variety of # ways based on the MM version. my $makemaker = eval $ExtUtils::MakeMaker::VERSION; # If we are passed a param, do a "newer than" comparison. # Otherwise, just return the MakeMaker version. sub makemaker { ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0 } # Ripped from ExtUtils::MakeMaker 6.56, and slightly modified # as we only need to know here whether the attribute is an array # or a hash or something else (which may or may not be appendable). my %makemaker_argtype = ( C => 'ARRAY', CONFIG => 'ARRAY', # CONFIGURE => 'CODE', # ignore DIR => 'ARRAY', DL_FUNCS => 'HASH', DL_VARS => 'ARRAY', EXCLUDE_EXT => 'ARRAY', EXE_FILES => 'ARRAY', FUNCLIST => 'ARRAY', H => 'ARRAY', IMPORTS => 'HASH', INCLUDE_EXT => 'ARRAY', LIBS => 'ARRAY', # ignore '' MAN1PODS => 'HASH', MAN3PODS => 'HASH', META_ADD => 'HASH', META_MERGE => 'HASH', PL_FILES => 'HASH', PM => 'HASH', PMLIBDIRS => 'ARRAY', PMLIBPARENTDIRS => 'ARRAY', PREREQ_PM => 'HASH', CONFIGURE_REQUIRES => 'HASH', SKIP => 'ARRAY', TYPEMAPS => 'ARRAY', XS => 'HASH', # VERSION => ['version',''], # ignore # _KEEP_AFTER_FLUSH => '', clean => 'HASH', depend => 'HASH', dist => 'HASH', dynamic_lib=> 'HASH', linkext => 'HASH', macro => 'HASH', postamble => 'HASH', realclean => 'HASH', test => 'HASH', tool_autosplit => 'HASH', # special cases where you can use makemaker_append CCFLAGS => 'APPENDABLE', DEFINE => 'APPENDABLE', INC => 'APPENDABLE', LDDLFLAGS => 'APPENDABLE', LDFROM => 'APPENDABLE', ); sub makemaker_args { my ($self, %new_args) = @_; my $args = ( $self->{makemaker_args} ||= {} ); foreach my $key (keys %new_args) { if ($makemaker_argtype{$key}) { if ($makemaker_argtype{$key} eq 'ARRAY') { $args->{$key} = [] unless defined $args->{$key}; unless (ref $args->{$key} eq 'ARRAY') { $args->{$key} = [$args->{$key}] } push @{$args->{$key}}, ref $new_args{$key} eq 'ARRAY' ? @{$new_args{$key}} : $new_args{$key}; } elsif ($makemaker_argtype{$key} eq 'HASH') { $args->{$key} = {} unless defined $args->{$key}; foreach my $skey (keys %{ $new_args{$key} }) { $args->{$key}{$skey} = $new_args{$key}{$skey}; } } elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { $self->makemaker_append($key => $new_args{$key}); } } else { if (defined $args->{$key}) { warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n}; } $args->{$key} = $new_args{$key}; } } return $args; } # For mm args that take multiple space-seperated args, # append an argument to the current list. sub makemaker_append { my $self = shift; my $name = shift; my $args = $self->makemaker_args; $args->{$name} = defined $args->{$name} ? join( ' ', $args->{$name}, @_ ) : join( ' ', @_ ); } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), ); } sub realclean_files { my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; %$realclean = ( %$realclean, FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [ shift ]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub _wanted_t { } sub tests_recursive { my $self = shift; my $dir = shift || 't'; unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } my %tests = map { $_ => 1 } split / /, ($self->tests || ''); require File::Find; File::Find::find( sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 }, $dir ); $self->tests( join ' ', sort keys %tests ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; # Check the current Perl version my $perl_version = $self->perl_version; if ( $perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; } # Make sure we have a new enough MakeMaker require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { # This previous attempted to inherit the version of # ExtUtils::MakeMaker in use by the module author, but this # was found to be untenable as some authors build releases # using future dev versions of EU:MM that nobody else has. # Instead, #toolchain suggests we use 6.59 which is the most # stable version on CPAN at time of writing and is, to quote # ribasushi, "not terminally fucked, > and tested enough". # TODO: We will now need to maintain this over time to push # the version up as new versions are released. $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name; $args->{NAME} =~ s/-/::/g; $args->{VERSION} = $self->version or die <<'EOT'; ERROR: Can't determine distribution version. Please specify it explicitly via 'version' in Makefile.PL, or set a valid $VERSION in a module, and provide its file path via 'version_from' (or 'all_from' if you prefer) in Makefile.PL. EOT if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; $args->{test} = { TESTS => (join ' ', grep {!$seen{$_}++} @tests), }; } elsif ( $Module::Install::ExtraTests::use_extratests ) { # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness. # So, just ignore our xt tests here. } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { $args->{test} = { TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ), }; } if ( $] >= 5.005 ) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = join ', ', @{$self->author || []}; } if ( $self->makemaker(6.10) ) { $args->{NO_META} = 1; #$args->{NO_MYMETA} = 1; } if ( $self->makemaker(6.17) and $self->sign ) { $args->{SIGN} = 1; } unless ( $self->is_admin ) { delete $args->{SIGN}; } if ( $self->makemaker(6.31) and $self->license ) { $args->{LICENSE} = $self->license; } my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->requires) ); # Remove any reference to perl, PREREQ_PM doesn't support it delete $args->{PREREQ_PM}->{perl}; # Merge both kinds of requires into BUILD_REQUIRES my $build_prereq = ($args->{BUILD_REQUIRES} ||= {}); %$build_prereq = ( %$build_prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->configure_requires, $self->build_requires) ); # Remove any reference to perl, BUILD_REQUIRES doesn't support it delete $args->{BUILD_REQUIRES}->{perl}; # Delete bundled dists from prereq_pm, add it to Makefile DIR my $subdirs = ($args->{DIR} || []); if ($self->bundles) { my %processed; foreach my $bundle (@{ $self->bundles }) { my ($mod_name, $dist_dir) = @$bundle; delete $prereq->{$mod_name}; $dist_dir = File::Basename::basename($dist_dir); # dir for building this module if (not exists $processed{$dist_dir}) { if (-d $dist_dir) { # List as sub-directory to be processed by make push @$subdirs, $dist_dir; } # Else do nothing: the module is already present on the system $processed{$dist_dir} = undef; } } } unless ( $self->makemaker('6.55_03') ) { %$prereq = (%$prereq,%$build_prereq); delete $args->{BUILD_REQUIRES}; } if ( my $perl_version = $self->perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; if ( $self->makemaker(6.48) ) { $args->{MIN_PERL_VERSION} = $perl_version; } } if ($self->installdirs) { warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS}; $args->{INSTALLDIRS} = $self->installdirs; } my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_} ) } keys %$args; my $user_preop = delete $args{dist}->{PREOP}; if ( my $preop = $self->admin->preop($user_preop) ) { foreach my $key ( keys %$preop ) { $args{dist}->{$key} = $preop->{$key}; } } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); } sub fix_up_makefile { my $self = shift; my $makefile_name = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; eval { flock MAKEFILE, LOCK_EX }; my $makefile = do { local $/; }; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; # Module::Install will never be used to build the Core Perl # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; seek MAKEFILE, 0, SEEK_SET; truncate MAKEFILE, 0; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; 1; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 544 Module-Install-1.06/MANIFEST0000644000175100017510000000426011723671717014030 0ustar adamadamChanges inc/Module/Install.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/inc/Module/Install.pm lib/inc/Module/Install/DSL.pm lib/Module/AutoInstall.pm lib/Module/Install.pm lib/Module/Install.pod lib/Module/Install/Admin.pm lib/Module/Install/Admin/Bundle.pm lib/Module/Install/Admin/Compiler.pm lib/Module/Install/Admin/Find.pm lib/Module/Install/Admin/Include.pm lib/Module/Install/Admin/Makefile.pm lib/Module/Install/Admin/Manifest.pm lib/Module/Install/Admin/Metadata.pm lib/Module/Install/Admin/ScanDeps.pm lib/Module/Install/Admin/WriteAll.pm lib/Module/Install/API.pod lib/Module/Install/AutoInstall.pm lib/Module/Install/Base.pm lib/Module/Install/Bundle.pm lib/Module/Install/Can.pm lib/Module/Install/Compiler.pm lib/Module/Install/Deprecated.pm lib/Module/Install/DSL.pm lib/Module/Install/External.pm lib/Module/Install/FAQ.pod lib/Module/Install/Fetch.pm lib/Module/Install/Include.pm lib/Module/Install/Inline.pm lib/Module/Install/Makefile.pm lib/Module/Install/MakeMaker.pm lib/Module/Install/Metadata.pm lib/Module/Install/PAR.pm lib/Module/Install/Philosophy.pod lib/Module/Install/Run.pm lib/Module/Install/Scripts.pm lib/Module/Install/Share.pm lib/Module/Install/Win32.pm lib/Module/Install/With.pm lib/Module/Install/WriteAll.pm LICENSE Makefile.PL MANIFEST This list of files META.yml MYMETA.json README t/01_compile.t t/02_mymeta.t t/03_autoinstall.t t/04_version.t t/05_share.t t/06_ppport.t t/07_perl_version.t t/08_dsl.t t/09_read.t t/10_test.t t/11_extraction.t t/12_eumm_params.t t/13_author_tests.t t/13_author_tests_ext.t t/13_author_tests_ext2.t t/14_auto_include_deps_with_version.t t/15_wrong_usage.t t/16_require.t t/17_sign.t t/18_all_from.t t/19_authors.t t/20_authors_with_special_characters.t t/21_makemaker_args.t t/22_installdirs.t t/23_pl_files.t t/24_multiple_license_blocks.t t/25_perl_version_from.t t/26_unknown_func.t t/27_build_requires_and_include.t t/28_makemaker_args.t t/29_requires_from.t t/30_build_subdirs.t t/31_add_metadata.t t/lib/Test.pm t/recursive/test.t xt/licenses.t xt/meta.t xt/pmv.t xt/pod.t Module-Install-1.06/Changes0000644000175100017510000011162211723671377014175 0ustar adamadamChanges for Perl programming language extension Module-Install 1.06 Thu 1 Mar 2012 - Adding can_xs command, imported from Params::Util (ADAMK) - Adding requires_xs command, wrapping around can_xs (ADAMK) 1.05 Thu 28 Feb 2012 - Use Module::Metadata instead of require to check versions for modules that we don't need to subsequently use (MSTROUT/MIYAGAWA) Use EU:MM instead of Module::Metadata to check versions for modules that we don't need to subsequently use (ADAMK) - Removed automatic EU:MM version detection as it was using versions in the future, change to a fixed version, unf (ADAMK) 1.04 Thu 20 Oct 2011 - Fixed _cmp to compare properly (MIYAGAWA) - Fixed the automated MakeMaker dependency addition (MIYAGAWA) - Last Perl 5.5 compatible MakeMaker was actually 6.36 (ADAMK) 1.03 Wed 19 Oct 2011 - META.yml flag dynamic_config is now always generated (ADAMK) - Added the convenience command static_config, as the default is to be dynamic (ADAMK) - Module::Install::DSL will automatically set static_config unless it can see an 'if' or 'unless' suffix (ADAMK) 1.02 Thu 29 Sep 2011 - Support for installdeps_target in Module::Install::AutoInstall and Module::AutoInstall (Caelum) - Support for installdeps_notest, upgradedeps and upgradedeps_notest, listdeps and listalldeps targets in Module::AutoInstall (Caelum) 1.01 Wed 27 Apr 2011 - Better error message in install_share (CHORNY) - Compatibility with MYMETA.yml support in EUMM (CHORNY) - Support for extraction of Artistic 2.0 license (CHORNY) - Support https links when searching for bug trackers (CHORNY) 1.00 Tue 22 Jun 2010 - Remove obsolete text warning about nonexistent auto_install() woes - auto_install() wrongly merged build_requires entries into requires; note that it's correct build_requires entries are merged into requires if you use older versions of EUMM, which didn't support build_requires. (ISHIGAKI) 0.99 Tue 1 Jun 2010 - FindBin->again only works on 5.8.3 0.98 Mon 21 May 2010 - Resolved #57326: Tests fail when being run in parallel (by Florian Ragwitz) (ISHIGAKI) - Resolved #57335: Re: Problem with Module::Install + Fix (by Paul Makepeace) (ISHIGAKI) - Added "add_metadata" to add extra (experimental) metadata to META.yml (requested by Florian Ragwitz) (ISHIGAKI) - Fixed a test to check EU::MM version as only newer EUMM has MIN_PERL_VERSION (ISHIGAKI) - Made fixup_makefile a bit robust, not to be interfered by antivirus etc (ISHIGAKI) 0.97 Mon 10 May 2010 - Added missing LWP dependency, starting with 2 year old version (ADAMK) 0.96 Tue 10 May 2010 - Stop Bundle.pm pointlessly calling import() of bundled modules (MSTROUT) - Resolved #55464: Wrong license detection (by Jens Rehsack) (ISHIGAKI) - Resolved #55594: Missing license (by Salve J. Nilsen) (ISHIGAKI) - Resolved #5849 (load_extensions() causes "Subroutine %s redefined" warnings) (by Steve Hay) (ISHIGAKI) - Resolved #19445: unknown functions in Makefile.PL should fail. and #19449: license is not found if unknown function is present (both are the same issue) (ISHIGAKI) - Resolved #54890: MYMETA.yml creation doesn't work (by miyagawa) (ISHIGAKI) - Resolved #55974: FakeAdmin does not define (by Francesc Guasch) (ISHIGAKI) - Resolved #40230: test_requires and include (by Alexandr Ciornii) (ISHIGAKI) - Resolved #56460: Bundle documentation error? (by Florent Angly) (ISHIGAKI) - Resolved #56459: Cannot find bundle source for modules that contain sub-modules (patch by Florent Angly) (ISHIGAKI) - Resolved #56474: Dependency check error fails to be triggered (by Florent Angly) (ISHIGAKI) - Resolved #5528: Sub-directory builds don't work (by Steve Hay) (ISHIGAKI) - Resolved #56531: New patches for M::I::Bundle (patch by Florent Angly) (ISHIGAKI) - Resolved #56589 for Module-Install: Bundle's refactor (patch by Florent Angly) (ISHIGAKI) - Pass VERSION_FROM to EU::MM in the background to let it check version integrity (ISHIGAKI) - Improved tests and removed unnecessary directories/files (ISHIGAKI) - Added API.pod and FAQ.pod (ISHIGAKI) 0.95 Wed 10 Mar 2010 - Resolved #51614: POD nits (by Frank Wiegand) (ISHIGAKI) - Resolved #51077: auto_include_deps would mention the (test|build)_requires version. (by Tokuhiro Matsuno) (ISHIGAKI) - Resolved #51267: Consider moving load checks to import so require M::I will succeed (by David Golden) (ISHIGAKI) - Resolved #55050: Module::Install::AuthorTests is broken with M::I 0.93 and 0.94 (by AEvar Arnfjord Bjarmason) (ISHIGAKI) - Resolved #16569: author should take array to match META.yml spec and Module::Build (by MARKSTOS) (ISHIGAKI) - Resolved #53984: Don't use ExtUtils::Install to copy into blib (by Michael G Schwern) (ISHIGAKI) - Resolved #17893: Module::Install::Share ignores MANIFEST (ISHIGAKI) - Resolved #24194: Error msg: Your installer Makefile.PL has a modification time in the future (by RSAVAGE) (ISHIGAKI) - Resolved #33976: cc_inc_paths replaces INC provided on command line (by David Golden) (ISHIGAKI) - Resolved #25972: makemaker_args INSTALLDIRS => 'perl'; doesn't work (by TELS) (ISHIGAKI) - Resolved #45978: .pm.PL runs in wrong order for WriteMakefile (by Hilary Holz) (ISHIGAKI) - Resolved #19783: Query CPAN for new versions of Module::Install during "make dist" (by Steffen Mueller) (ISHIGAKI) - Resolved #27242: Bug(s) in license_from() (by Steve Hay) (ISHIGAKI) - Now license is properly passed to the EU::MM in the background (ISHIGAKI) - Added non-interactive session support, part of which was there some time before (ISHIGAKI) 0.94 Tue 23 Feb 2010 - Fixed critical author/xt bug (ADAMK) 0.93 Sun 7 Feb 2010 - Better search for 'Perl' license (CHORNY) - Added automatic executing of xt tests during either author() mode or when RELEASE_TESTING is enabled (ADAMK) 0.92 Thu 21 Jan 2010 - Support github.com bugtracker (CHORNY) - Made the matching phrase for the perl license a bit shorter to allow "the same terms as Perl 5.10" etc (ISHIGAKI) - Refactor part of license_from to separate sub, tests for a new sub (CHORNY) - Refactor part of perl_version_from to separate sub, tests for a new sub (CHORNY) - Allow spaces at the start of string when using perl_version_from (CHORNY) - The all_from command now stores the filename in the 'all_from' key for later reuse (MARCEL) - Support code.google.com bugtracker (CHORNY) - If the DSL code fails, say why (ADAMK) - Now autoinstall doesn't die on CPAN-1.81 (JJORE) - Check 'copyrights' section for license also (CHORNY) - Test passing correct params to EU::MM (CHORNY) - Use BUILD_REQUIRES EU::MM param for better OS packages (CHORNY) - Bundled prereqs will be removed from build prereqs only (CHORNY) - Use MIN_PERL_VERSION EU::MM param (CHORNY) - Better search for 'Perl' license (CHORNY) - Adding 'makemaker' command to make EU:MM version conditionals easier (ADAMK) - Removed a variety of Perl::MinimumVersion complaints (ADAMK) 0.91 Thu 28 May 2009 - Add missing dependency on Parse::CPAN::Meta 0.90 Fri 22 May 2009 - Adding a first implementation of MYMETA 0.89 Wed 20 May 2009 - _load_cpan now also checks for $CPAN::Config before assuming that CPAN and its config are properly loaded (HDP) - Changes file is now TIOBE compatible (ADAMK) - license_from now support a TIOBE-compatible declaration (ADAMK) (...under the same terms as the Perl programming language itself) 0.88 Thu 14 May 2009 - Show what version is currently installed when deps are not new enough (patch by RIBASUSHI, applied by MSTROUT) - Tweak _check_lock to not load CPAN when new enough -and- no env vars present - otherwise we still accidentally configure the thing for no good reason (MSTROUT, feeling particularly dumb) - Module::Install::Admin::Include now had a '=head1 NAME', which should avoid problems when generating man pages. Many thanks to Simon Bertrang for the patch. (PJF, RT #45811) 0.87 Thu 7 May 2009 - The other half of MSTROUT's changes - A note mentioning to bug MSTROUT if you run into problems 0.86 Sat 2 May 2009 - Add --alldeps option to say yes to optional dependencies (MSTROUT) - Alter _check_lock to test the CPAN version and use PERL5_CPAN_IS_RUNNING if new enough so we don't accidentally configure CPAN unless it's so old we have no choice (MSTROUT) - Tweak the SkipInstall logic so --skipdeps bypasses everything again including any loading of CPAN, no matter how old (MSTROUT) - Adding ./example, ./test and ./xt to the no_index list (ADAMK) - Removed $VERSION from the tests (ADAMK) - Various POD fixes (ADAMK) 0.85 Sun 19 Apr 2009 - Adam Kennedy - All files no use strict to satisfy Kwalitee (ADAMK) 0.84 Tue 14 Apr 2009 - Adam Kennedy - Fix incorrect if => unless conversion (CHORNY) 0.83 Tue 14 Apr 2009 - Adam Kennedy - Module::Install::DSL wasn't correctly loading the main Module::Install package when trying to install on a host that didn't have M:I installed locally (CSJEWELL) - Module::Install no longer supports Perl versions less than 5.005, so we can now safely just "require" File::Spec (ADAMK) 0.82 Wed 9 Apr 2009 - Adam Kennedy - If configure_requires has ExtUtils::MakeMaker and it's version requires perl 5.6, require perl 5.6 for dist in META.yml (CHORNY) - Fixes to Module/AutoInstall.pm: (MSTROUT) - don't prompt for required dependencies under CPAN/CPANPLUS - allow PERL_AUTOINSTALL_PREFER_CPAN env var to disable cpanp use - Module::Install::DSL now correctly installs itself into the generated tarball (ADAMK) - Preferentially dispatch leading-underscore methods used in plugins to the main Module::Install object (ADAMK) 0.81 Tue 24 Mar 2009 - Adam Kennedy - Use 3-argument open when Perl >= 5.006 (ADAMK) - Support for 'keywords' key in META.yml (CHORNY) - More URLs for licenses, test for this (CHORNY) - tests for extracting link to bugtracker, will more correctly extract them (CHORNY) - Adding version-normalising Module::Install::_cmp (for <=> equivalent on versions) (ADAMK) - If the Makefile.PL time is in the future by only a few seconds (probably due to 2-second filesystem time rounding on Win32) sleep for 5 seconds to avoid the problem. (ADAMK) - Moving from Module::Install::DSL to inc::Module::Install::DSL (to reduce the Makefile.PL header for DSL mode to one line) (ADAMK) - Adding convenience pod reading Module::Install::_readpod (ADAMK) - Adding convenience pod stripping Module::Install::_readperl (ADAMK) - Adding experimental requires_from command to auto-detect requires (ADAMK) - Add a "Writing MYMETA.yml" status message (ADAMK) - Generalising boolean commands (ADAMK) - Cleaner removal of files during realclean (ADAMK) - Write META.yml and MYMETA.yml after Makefile to pick up a couple of extra implicit dependencies. (ADAMK) - Set a high configure_requires on ExtUtils::MakeMaker for any client that supports configure_requires. (ADAMK) - Add a full resolution test for Module::Install::DSL (ADAMK) - If we write MYMETA.yml, remove it at realclean time (ADAMK) - Removed the 'Removing META.yml' warning 0.80 Tue 17 Mar 2009 - Adam Kennedy - Don't generate MYMETA.yml if we don't have YAML::Tiny, even if we've said we need it. This was breaking Catalyst. (ADAMK) - Will not ask about auto-installing mandatory dependencies, if $ENV{PERL5_CPANPLUS_IS_RUNNING} is set (CHORNY) 0.79 Wed 4 Feb 2009 - Adam Kennedy - Upgrading (and testing) Perl version normalisation - Adding an experimental-grade implementation of MYMETA.yml 0.78 Sun 25 Jan 2009 - Adam Kennedy - Much more aggressive dependencies, except PAR::Dist (ADAMK) - Adding inc::Module::Install::DSL for simple installs (ADAMK) - We now avoid poking references in @INC in case they have strange overload behaviours. (PJF, RT #39929) - installdirs and install_as_* are now documented in Module/Install.pod (PJF, RT #25111) - Applied patch RT #38443 from Oleg Kostyuk for two-part version numbers being passed to perl_version. Calling 'perl_version 5.8' should now work the same as 'perl_version 5.008'. Additional tests added to t/07_perl_version.t to check this. (PJF, RT #38443) - Module::Install no longer complains about the phrase "All rights reserved" in association with open source licenses. (PJF, RT #41268) 0.77 Fri 8 Aug 2008 - Adam Kennedy - Don't break directories starting with inc(oming) (ADAMK, RT #30637) - Adding more phrases to recognise GPL variants (ADAMK, RT #35195) - Skip 03_autoinstall.t except at release, as it can hang in some situations (ADAMK, #29448) - Add a file check to the all_from param (ADAMK, #24586) - Fixed bug in can_run when PATH starts with a sep (ADAMK, #29866) - Don't overwrite dist args if there is a preop (ADAMK, #36831) - Bug fix in the command dispatcher (ADAMK, #27327) - perl_version now understands three-part Perl versions like 5.8.1 (PJF, RT #38317) - Numify version.pm objects when generating YAML (ADAMK) 0.76 Thu 17 Jul 2008 - Adam Kennedy - ExtUtils::MakeMaker no longer complains when its version contains an underscore. (PJF, RT #35800) - Documentation patches to Module::Install::Admin and Module::Install::Base. (Adriano Ferreira, RT #27696) - Corrected broken internal link in Module/Install.pod. (PJF) - The 'examples' directory will no longer be included twice in META.yml/no_index/directory. (PJF) - Move to the new 1.4 version of the META.yml specification (ADAMK) - Automatically provide resources:license for license('perl') (ADAMK) - Implemented the bugtracker_from command (ADAMK) - Added bugtracker_from to the all_from command (Although we don't warn if not provided) (ADAMK) - Shifting minimum perl version for Module::Install to 5.005 (Anything older should use ExtUtils::MakeMaker) (ADAMK) - perl_version errors if it gets a value less that 5.005 (ADAMK) - Created the new install_share implementation (ADAMK) - Added the ppport function for adding ppport.h (ADAMK) - Bumped File::Remove from test_requires to requires (ADAMK) - Added dependency on Devel::PPPort for ppport (ADAMK) 0.75 Mon 2 Jun 2008 - Adam Kennedy - Documenting the smaller post Module::Build core package Module::Install::With and removed experimental warning (ADAMK) - Disabled the broken install_share error check (CLACO) - Disabled "pointless version 0" warning, as it encourages less metadata (ADAMK) - Adding an experimental undocumented implementation of a "resources" and "repository" command (ADAMK) - Don't dump "tests" and "installdirs" to META.yml (ADAMK) 0.74 Mon 26 May 2008 - Adam Kennedy - Fix incorrect comparison of module and distribution names (RJBS) - Allow "require" instead of "use" when finding required perl version (RJBS) - Remove the -f Build.PL check, as it was breaking for people trying to convert from M:B to M:I or vice versa (MSTROUT) 0.73 Wed 14 May 2008 - Adam Kennedy - Aggressively increase dependencies for authors to make sure all the latest release-time tricks will work properly. (ADAMK) - When generating META.yml where there is an overall Perl version dependency, add a test for unversioned core dependencies that MUST already be satified by the Perl dependency. (ADAMK) - Merged Module::Install MANIFEST.SKIP into the repository default MANIFEST.SKIP file, and deleted the M:I one (ADAMK) 0.72 Tue 15 Apr 2008 - Adam Kennedy - exit(0) on requires_external_bin to make it a real NA (ADAMK) - Change docs to recommend the use of test_requires instead of build_requires. They do the same thing now, but this may change in the future and in that case better people use test_requires now as it is a more accurate description of intent. Also, it reads clearer. (ADAMK) - Removed the command prompt_script, it did some unusual magic and it easy enough to replace with 2 lines of code in the Makefile.PL of anyone using it anyway (ADAMK) - Merged the remaining install_script into Metadata.pm (ADAMK) - Adding documentation about the configure_requires command (ADAMK) - Automatically add any install_share directory to no_index (ADAMK) - Check scripts passed to install_script actually exist (ADAMK) - Allow install_script('foo') to be shorthand for install_script('script/foo') if no root 'foo' file exists. This should allow for yet more typing reduction (ADAMK) - For even more typing reduction, "use inc::Module::Install" now acts as an implicit "use strict", so you don't need to use strict in Makefile.PL (ADAMK) - Fixed a regex bug in name_from (and thus all_from) (ADAMK) 0.71 Mon 24 Mar 2008 - Adam Kennedy - YAML::Tiny is now good enough to use exclusively (ADAMK) - Converted Changes file to my normal format, so that my release automation can deal with it properly (ADAMK) - Added name_from to auto-detect name, and include name_from in all_from, so now no name line is needed at all in the Makefile.PL (ADAMK) - Removed the redundant Module::Install::Makefile::Name and Module::Install::Makefile::Version, they were almost never used and were a bit too magic. (ADAMK) - Adding a "wrote" flag to the M:I object in preparation for making WriteAll implicit by default (ADAMK) - Correcting 01_compile.t to check for 5.004 instead of 5.005 (ADAMK) - Added Module::Install::_version to numify CPAN-like versions properly (ADAMK) - Split TestHelper out as it's own t/lib/Test module (ADAMK) - Upgrade from File::Path::rmtree to File::Remove::remove in the test scripts. (ADAMK) - Various documentation clean ups (ADAMK) - If building in author mode, make sure that auto-generated META.yml files are deleted properly during 'make clean' (ADAMK) 0.70 Tue 18 Mar 2008 - Adam Kennedy - Temporarily restoring auto_install until Matt Trout can craft a replacement for their installdeps needs, and for feature support (ADAMK) 0.69 Sat 15 Mar 2008 - Adam Kennedy - Removing auto_install support (ADAMK) - Removing Build.PL support (ADAMK) - Enabling configure_requires support (ADAMK) - Automatically set a configure_requires for the version of ExtUtils::MakeMaker that the author is running (ADAMK) - Refactoring a number of modules for reduced size (ADAMK) - Add 'share' to the list of directories automatically no_index'ed (ADAMK) - license_from correctly marks "GNU lesser public license" as lgpl, not gpl [rt.cpan.org 24635] (AVAR) - set author mode ($Module::Install::AUTHOR) when first creating ./inc (RJBS) - Don't write perl into PREREQ_PM when using perl_version (ADAMK) 0.68 - Ricardo Signes - The author entry in META.yml is now a sequence, as required 0.67 - Adam Kennedy - Tweaked the license detection code a bit - Previous changes working well, going production 0.66_02 - Adam Kennedy - Adding detection of 'proprietary' license. - "All rights reserved" clashes with or can invalidate most Open Source licenses. Adding a warning to this effect. 0.66_01 Thu 15 Mar 2007 - Adam Kennedy - Adding tests_recursive to have M:I search for and explicitly list all test scripts recursively. - Adding configure_requires, test_requires and install_requires. These are currently aliases for build_requires but will later result in alternative consequences internally (ADAMK) - Reorganising Module::Install::With on the assumption that CPAN.pm will be implementing PERL5_CPAN_IS_EXECUTING. 0.65 Tue 6 Mar 2007 - Adam Kennedy - Add install_as_core, install_as_cpan, install_as_vendor commands to control the "installdirs" metadata field. Requested by: Tels (renamed by ADAMK and AUDREYT) - Add the preop command for users to customize the PREOP rule. (BINGOS) - Implement support for $ENV{PERL5_CPANPLUS_IS_EXECUTING} in the experimental Module::Install::With. (ADAMK) - Remove the use of features in the Module::Install Makefile.PL. Developers should be quite capable of installing them all. (ADAMK) - Remove the use of auto_provides in Module::Install Makefile.PL until we fix it to not break without a pre-existing MANIFEST. (ADAMK) - YAML::Tiny is now used as a fallback for generating META.yml. The order of precedence is now YAML::Syck, YAML::Tiny, then YAML. - META.yml output is now conformant to spec 1.3. - Add MIT license to those detectable by license_from() (GAAL) 0.64 Thu 24 Aug 2006 - Adam Kennedy - auto_install() will no longer invoke CPAN.pm or CPANPLUS recursively when running under CPANPLUS (i.e., when $ENV{PERL5_CPANPLUS_IS_RUNNING} is set to a true value.) - auto_install() would not follow prerequisites of requires() when the module is installed from the command line and only CPAN.pm is installed. [rt.cpan.org 21139] (MSCHWERN) 0.63 Mon 5 Jun 2006 - Adam Kennedy - "make" gets confused if the Makefile.PL time is in the future, but there is no universal fix for this. As an initial solution, catch the error situation and die with an error to the user. (ADAMK) - Adding additional notes on no_index package (ADAMK) - Removing hashbang from Makefile.PL and using a $^W = 1 instead (ADAMK) 0.62 Wed 3 May 2006 - Adam Kennedy - Various small back-compatibility bugs squashed, since we advertise that a M:I installer should run back to 5.004 (AUDREYT) - Allow non-admin installs to do so without the need for YAML.pm (AUDREYT) - Adding an initial implementation of Module::Install::With, containing code to detect the existance of other members of the Perl toolchain, and how we are related to them in any given install run. Initial experimental implementation of CPAN.pm and CPANPLUS detection, based on code extracted from Module::AutoInstall, and other code recommended by the relevant authors. Leaving the new commands undocumented for now, and recommend NOT making general use of them until tested. (ADAMK) - In order to implement any form of version locking, which need to know which extensions are in the core (and thus version-locked) and which are custom extensions with legally out-of-sync versions. Added $ISCORE = 1 global to every potentially-bundled core extention, for when we start to do version locking. (ADAMK) - The install_share Makefile fragment fails on older ExtUtils::Install versions. When we install_share, add an explicit EU::MakeMaker dependency. Would have done on just ExtUtils::Install, but it isn't PREFIX/PERL5LIB-safe. (ADAMK) - Some/many versions of MakeMaker incorrectly set PERL_LIB and PERL_ARCHLIB, which is only supposed to be used for building the core Perl. Since we'll never be doing that, make the Makefile munger blank them if they exist. This lets PREFIX + PERL5LIB for installing private modules work again. (except not PERL_ARCHLIB for now, it's not getting in the way, and for some reason it's used for something else) (ADAMK) 0.61 Sat 15 Mar 2006 - Adam Kennedy - ActivePerl::Config on case-insensitive filesystems interacts erroneously with Module::Install's (outdated) @INC hack, so remove it. (Patch from Gisle Aas) - Improve compatibility with ExtUtils::MakeMaker 5.x by not relying on FIRST_MAKEFILE being set in the MM instance. - Remove optional dependency on CPANPLUS. (INGY) - Add "realclean_files" command to add files to be cleaned on "make realclean", instead of "make clean". (INGY) - Add $VERSION back to inc::Module::Install so we can implement workarounds and back-compatibility code later on. (ADAMK) 0.60 Tue 11 Mar 2006 - Adam Kennedy - Cleaned up the 0.59 fix a bit and added a bunch of comments explaining the bootup mechanism. A misunderstanding of this on my part led to the 0.58 bug. Sorry folks (ADAMK) - Resolved #18040: bundled Module::Install leaks private information Debugging information in Module::Install::Admin was leaking potentially sensitive information. Removed just the files, left the lines (TELS) - Fixed a smaller part of the problem with 0.58 that still hurts people if that are an installer AND an author as well. (Reported by dha) 0.59 Fri 7 Mar 2006 - Adam Kennedy - Resolved #18020: 0.58 was broken; inc::Module::Install's @ISA and $VERSION needs to be set by Module::Install on its behalf. (TELS) 0.58 Tue 4 Mar 2006 - Adam Kennedy - Made Module::AutoInstall generally aware of AUTOMATED_TESTING - Added compatibility with 5.9.3 proxy constants - Resolved #11169: problems on VMS. This doesn't mean there won't be problems on VMS though, as this path is oldish and their may be more problems. - Added AUTOMATED_TESTING support to prompt() to force the selection of the default (via PERL_MM_USE_DEFAULT) when it is enabled. - Added infinite loop protection to prompt() just in case automated and/or shortcutted responses to prompts go badly and leave us looping over the same question. - Fixed #17961 Use of uninitialized value in array dereference at Module/Install/Metadata.pm line 163. (TELS) 0.57 Thu 23 Feb 2006 - Adam Kennedy - Fixed a bug where a misnamed hash key was making the extensions fruitlessly reload (or at least try to reload) every command call. - Fixed a pod bug for the requires_external_bin head2 - Because external deps will need versioning eventually, we can never provide a hash to requires_external, and so it's really just supurfluous and invites more bugs. Removed. - Experimentally added support for the META.yaml dynamic_config flag. We don't set ANY default value, because of a lack of clarity. It is undocumented in the META.yaml spec, but false in Module::Build, which is really really bad, as it leads to falsely assuming dynamic Makefile.PLs are static when no dynamic_config is provided. Personally, I think it should be static_config anyway, and we may well change it to be that anyway. - Added support for requires_external_cc (requires a C compiler) that will integrate with whatever central method we use later to signal to whatever is calling Makefile.PL that there is a missing external dependency. This will also be called by other methods if there is an implicit dependency. - Synchronised all the module versions to all be 0.57. This will be used a few versions down the line to add integrity testing of Module::Install's own extension loading process. - Added a $VERSION and C to the extensions that didn't have one or both of the two already. - Fixed a number of minor bugs discovered after turning on C. - Very carefully beginning to clean up some of the code so it's much more boring (i.e. maintainable). - Changed recursion to always preference the installer we are currently running under. So use CPAN.pm in CPAN.pm, and CPANPLUS in CPANPLUS. This simplifies anti-dupe recursion algorithms, and dramatically reduces memory use under CPAN.pm. - Documented the install_script command - Caught _install_cpanplus happily passing completely illegal CPAN.pm config params to CPANPLUS, and worse, eval-wrapping the set_conf so it could happily ignore errors. Added _cpanplus_config to try and auto-convert CPAN config params to CPANPLUS, and die if we can't. Add more translators as needed. - Moved the deprecated commands into their own module Module::Install::Deprecated to stop them being included and reduce package bloat. 0.56 Sun 12 Feb 2006 - Adam Kennedy - Added experimental support for requires_external_bin to forcefully require the installation of a script or command. - Removed a warning in Module::Install::Admin::MetaData when perl_version doesn't have a third part. 0.55 Fri 27 Jan 2006 - Adam Kennedy - This release only not signed (Released by ADAMK who has no keys) - Another pass over the POD to clean up and remove mistaked (ADAMK) - Module::Install::Share installs to blib/lib rather than blib/arch. Most files will be non-arch-specific, and it was causing problems down the road with File::ShareDir. All existing working install_share/File::ShareDir continues to work. - New command auto_include_dependent_dists() to recursively include dependent CPAN distributions for modules declared with build_requires(). This differs from auto_include_deps() because it works with whole distribution source trees, not just single modules. - Fix POD syntax so t/2-pod.t passes. Contributed by: Ishigaki Kenichi - Disable 5.00503-specific qr// construct in t/3-autoinstall.t so Perl 5.004 can build this module again. - YAML::Syck 0.27+ is now a preferred dependency over YAML 0.35+ for platforms with a C compiler and without either one available. 0.54 Wed 11 Jan 2006 - Fix can_run() on Cygwin for real. Contributed by: Mark Grimes 0.53 Wed 11 Jan 2006 - Fix can_run() on Cygwin for paths beginning with /cygdrive/. Reported by: Mark Staggs - If YAML::Syck is present on the system, use it instead of YAML.pm to write out META.yml. 0.52 Tue 3 Jan 2006 - Module::AutoInstall - disable "sudo" prompting for CPANPLUS 0.050 and CPAN.pm 1.80+ which already has "sudo" support. Reported by: Andreas Koenig 0.51 - 2005-12-31 - An additional 100+ lines of documentations in the Module::Install POD file. - all_from() with no args now attempts to decude the "from" file from the "name" property. - On Cygwin, sometimes AUTOLOAD is called with a gensym'ed package that does not define _top. Try to accomodate for this. - Do not ever attempt "sudo" without interactive consent from the user; make the _prompt() in Module::AutoInstall default to 'n' if we are not running in an interactive terminal. - Add lib_paths and lib_links commands to Module::Install::Compiler for setting LIBS flags. 0.50 Mon 26 Dec 2005 - Fixed the bug where cpan signing was set forcibly to true instead of defaulting to false. Reported by: Martin Thurn and Randal Schwartz - Module::Install::Admin's copy() subroutine was using a lot of CPU on inefficient regex matches, where a simple passthrough while() line-processing loop would do. - The t/ directory is now listed in META.yml's no_index entries by default, along with inc/. - YAML.pm is now listed as an explicit dependency. 0.48 Mon 26 Dec 2005 - New Module::Install::Compiler extension with commands: c_files(), inc_paths(), optimize_flags(). 0.47 Sun 25 Dec 2005 - Slight documentation cleanup and update Module::Install::Admin version to 0.47; no functional changes. 0.46 Thu 22 Dec 2005 - tests() should always take effect even if auto_install() or makemaker_args() had set it before. Reported by: Jesse Vincent. 0.45 Fri 16 Dec 2005 - Improved detection for author_from() based on the copyright line in addition to =head1 AUTHORS. - Bump version of Module::Install::Admin to match Module::Install. Reported by: Sebastian Riedel 0.44 Tue 13 Dec 2005 - Module::Install::Bundle now extract files correctly again; this was a regression since 0.40. Reported by: Randal Schwartz - Add support to Module::Includes::Bundle so each subdirectory can use Module::Install for bundling. - The "bundles:" key in META.yml is now populated even if the bundled modules already exist on the system. 0.43 Mon 12 Dec 2005 - Better documentation to install_share(). - New author_from() command to guess the author name from POD. - all_from() no longer probes for metadata that has been set before. 0.42 Sun 11 Dec 2005 - auto_provides() was broken due to a typo. - New command install_share() to put a directory's content into the per-distribution auto/ directory. 0.41 Sun 11 Dec 2005 - Only query '$self->tests' if we haven't been given an explicit list (From Paul Fenwick) - New command auto_provides() to calculate "provides:" information using Module::Build. Requested by Chia-Liang Kao. 0.40 Wed 7 Dec 2005 - Massively updated documentation (more to come later). - Parentheses are now optional in Makefile.PL. - Includes Module::AutoInstall, a cleaned-up version of ExtUtils::AutoInstall. - New command all_from() to combine all *_from() tests into one. - New command test() to Support specifying test files. - New command feature() to list individual features easily. 0.37 Thu 4 Aug 2005 - Always include ExtUtils::AutoInstall in inc/ if auto_install() is called. - Fixed a bug where modules having shared libraries would sometimes be included in inc/. - The needs shared library message will now only be printed if the module version indicates that it would otherwise be included. The module name has also been corrected so that "::" is used everywhere instead of "/". 0.36 Thu 9 Sep 2004 - First version under SVK management. - install_scripts() now takes multiple scripts to install. 0.35 Tue 13 Jul 2004 - Jos Boumans reported that "use inc::Module::Install 0.34" was failing because Module::Install does not assign VERSION to inc::Module::Install. - Implemented auto_include_deps() for real. 0.34 Thu 1 Jul 2004 - auto_include() will not include recursive dependencies now; that functionality is refactored into auto_include_deps(). 0.33 Thu 11 Mar 2004 - abstract_from() was broken; it works now thanks to SHAY. - WriteAll() now takes (inline => 1) to support Inline-based modules. 0.31 Wed 31 Dec 2003 - Allow auto_install() to take -core-specific options like (-default => 0). - No longer use inc/SCRIPT but simply modify the scripts to install. - Make can_cc() to probe the program part of $Config{cc} - Bundled M::I-using modules (or subdirs) used to break up spectacularly by overriding ::AUTOLOAD and reusing their parents' inc/*. Now the namespaces are keyed by cwd and more readily unregistered. 0.29 Sun 14 Dec 2003 - Introducing &WriteAll, a combination of &Meta->write, &check_nmake, &Makefile->write, and if a Build.PL is present (which should read "require 'Makefile.PL'"), also supports transparent &Build->write. - Real Module::Build support in WriteAll and in this module. - Transparent Build.PL, as promised in README, is back. - WriteAll now takes three non-metadata flags: check_nmake (default 1), meta (default 1) and sign (default 0). - The "private" key in META.yml is officially obsoleted by "no_index". - Now warns if the user did not specify a license. - "requires( perl => $version )" is now supported. - include_deps() now no longer takes its second argument; it must be separately supplied with the syntax above. - "&WriteAll" now officially replaces "&Build->write", "&Makefile->write", "&Meta->write" and "check_nmake()". - Implemented auto_include() and bundle_deps(). - Add "#defaults" to MANIFEST.SKIP. 0.28 Thu 11 Dec 2003 - Module::Install::Bundle now works, thanks to Adam Foxson! - Unbreak against newer EU::MM. - Let "inc" work with "make test" on 5.6.x too. - mcdavis pointed out that Microsoft now wants "Nmake15.exe", not "nmake15.exe". 0.27 Mon 27 Oct 2003 - Make the include'd modules actually work during "make" and "make test", by adding "inc" to the Makefile targets. - Graham's patch for 5.004 backcompat. - Graham Barr points out that readdir() can return 0. - Do not sign the distribution if we are not the admin. 0.26 Fri 17 Oct 2003 - sign(1) support for automatic digital signing. - no_index(directory => 'example') support, for telling PAUSE and search to skip indexing modules. 0.25 Mon 13 Oct 2003 - Add no_index as an alias to private in META.yml. - Support for YAML::Parser::Syck. - No point in supporting Build.PL now. 0.24 Mon 1 Sep 2003 - 0.17 is simply too old as it scans in POD sections. - Kingpin notes that we are using "next" outside a loop block in ScanDeps. - threads.pm and warnings.pm should be exempted too. 0.23 Mon 18 Aug 2003 - Implemented $self->is_admin to properly test if it's running on the admin side. - Andreas Koenig reports that we are writing META.yml even on the user side, because of this bug. - Switch to PAR::Dist to do make_par(). 0.22 Wed 16 Jul 2003 - Turns out that MakeMaker's NAME corresponds to META.yml's module_name, and DISTNAME corresponds to name. Reflect this in the relevant files. - Introduce a new module_name metadata key that may be automatically generated from name. - /\.pm/i should be /\.pm$/i. - Iain Truskett wants us to not overwrite alien META.yml files. - PREREQ_PM wasn't being filled out. - Should be including YAML dependencies too. - POD cleanups. 0.21 Sun 15 Jun 2003 - Lindsay Morris pointed out that include_deps() does not work with non-core modules; fixed. 0.20 Thu 5 Jun 2003 - Add pointer to ingy's TPJ article. - Eliminated warnings on 5.005. - Added the "package inc::Module::Install;" line at request by Graham Barr, for search.cpan.org. - Close META.yml before zipping; otherwise trips on win32. - requires(), build_requires(), recommends() etc can now take multiple pairs in addition to a single pair. - Add standard MANIFEST and META.yml to generated PAR file. - Implemented the &Meta->read mentioned in the main docs. - Our version of WriteMakefile was failing to fine Meta object; fixed. - 'make reset' now just an author side alias for 'make purge'. - The whole #! business is unneeded since MakeMaker does that. - Don't skip other non-pm inc/ stuff when checking MANIFEST. - The hashbang line should be the first, not last, in scripts. - Also people may not always like -w. - We reall want to rmtree() the distdir so that 'make manifest' won't include clobbered files after an aborted 'make dist'. - Fix consistency: ->prompt() should only take one line of prompt and expects y/n. Module-Install-1.06/t/0000755000175100017510000000000011723672002013124 5ustar adamadamModule-Install-1.06/t/12_eumm_params.t0000644000175100017510000000243711723671400016130 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 11; use File::Spec; use t::lib::Test; require ExtUtils::MakeMaker; use vars qw{ $PREREQ_PM $MIN_PERL_VERSION $BUILD_REQUIRES }; # Regular build SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; requires 'File::Spec' => '0.79'; WriteAll; END_DSL ok( run_makefile_pl(run_params=>['PREREQ_PRINT >test']), 'build_dist' ); my $file = file('test'); ok( -f $file); my $content = _read($file); ok( $content, 'file is not empty'); ok( $content =~ s/^.*\$PREREQ_PM = \{/\$PREREQ_PM = {/s,'PREREQ_PM found'); eval ($content); ok( !$@,'correct content'); ok( exists $PREREQ_PM->{'File::Spec'}); if ( eval($ExtUtils::MakeMaker::VERSION) < 6.55_03 ) { ok( exists $PREREQ_PM->{'ExtUtils::MakeMaker'}); ok( !exists $BUILD_REQUIRES->{'ExtUtils::MakeMaker'}); ok (1); } else { #best to check both because user can have any version ok( exists $BUILD_REQUIRES->{'ExtUtils::MakeMaker'}); ok( !exists $PREREQ_PM->{'ExtUtils::MakeMaker'}); is( $MIN_PERL_VERSION, '5.005' , 'correct Perl version'); } ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/20_authors_with_special_characters.t0000644000175100017510000000516111723671400022235 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use Parse::CPAN::Meta; use t::lib::Test; plan tests => 26; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; version '0.01'; license 'perl'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( add_file(qw(lib Foo.pm), <<'END') ); package Foo; 1; \__END__ \=head1 NAME Foo - Abstract \=head1 AUTHOR First 'Middle' Last \=cut END ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ author_makefile_re("First 'Middle' Last"), 'has one author') or do { $content =~ /^(#\s*AUTHOR => .*?)$/m; diag "String: $1"; }; my $metafile = file('META.yml'); ok(-f $metafile); my $meta = Parse::CPAN::Meta::LoadFile($metafile); is_deeply($meta->{author}, [qq(First 'Middle' Last)]); ok( kill_dist(), 'kill_dist' ); } if ($] >= 5.008) { eval "use utf8"; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; version '0.01'; license 'perl'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( add_file(qw(lib Foo.pm), <<'END') ); package Foo; 1; \__END__ \=head1 NAME Foo - Abstract \=head1 AUTHOR Olivier MenguE \=cut END ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ author_makefile_re("Olivier Mengu\xE9"), 'has one author'); my $metafile = file('META.yml'); ok(-f $metafile); my $meta = Parse::CPAN::Meta::LoadFile($metafile); is_deeply($meta->{author}, [qq(Olivier Mengu\xE9)]); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; version '0.01'; license 'perl'; author "Olivier Mengu\xE9"; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ author_makefile_re("Olivier Mengu\xE9"), 'has one author'); my $metafile = file('META.yml'); ok(-f $metafile); my $meta = Parse::CPAN::Meta::LoadFile($metafile); is_deeply($meta->{author}, [qq(Olivier Mengu\xE9)]); ok( kill_dist(), 'kill_dist' ); } } else { SKIP: { skip "this test requires perl 5.8", 17; } }Module-Install-1.06/t/10_test.t0000644000175100017510000000345411723671400014577 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use t::lib::Test; use YAML::Tiny (); plan tests => 14; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<'END_DSL' }), 'create_dist' ); use inc::Module::Install 0.82; name 'Foo'; license 'perl'; author 'Foo Bar '; all_from 'lib/Foo.pm'; requires 'perl' => '5.008000'; test_requires 'Test::More' => '0.47'; no_index 'directory' => qw{ t xt share inc }; install_share 'eg'; keywords 'kw1','kw 2'; keywords 'kw3'; license 'apache'; WriteAll; END_DSL unlink file('META.yml'); unlink file('MYMETA.yml'); ok( mkdir(dir('eg')), 'created eg/' ); ok( add_file('eg/sample', 'This is a sample'), 'added sample' ); ok( mkdir(dir('t')), 'created t/' ); ok( add_file('t/01_comile.t', <<'END_TEST'), 'added test' ); #!/usr/bin/perl BEGIN { $| = 1; $^W = 1; } use Test::More tests => 2; ok( $] >= 5.005, 'Perl version is new enough' ); use_ok( 'Foo', 'Loaded Foo.pm' ); END_TEST ok( build_dist(), 'build dist' ); my $metafile = file('META.yml'); ok( -f $metafile, 'META.yml created' ); my $meta = YAML::Tiny::LoadFile($metafile); is_deeply( [ sort @{ $meta->{no_index}->{directory} } ], [ qw{ eg inc t } ], 'no_index is ok', ) or diag( "no_index: @{ $meta->{no_index}->{directory} }" ); is_deeply( $meta->{keywords}, [ 'kw1','kw 2','kw3'], 'no_index is ok', ) or diag( "no_index: @{ $meta->{no_index}->{directory} }" ); is($meta->{license},'apache','license'); is($meta->{resources}->{license},'http://apache.org/licenses/LICENSE-2.0','license URL'); my $makefile = makefile(); ok( -f $makefile, 'Makefile created' ); my $content = _read($makefile); ok( $content =~ /^#\s+PREREQ_PM/m, 'PREREQ_PM found' ); ok( kill_dist(), 'kill dist' ); } Module-Install-1.06/t/07_perl_version.t0000644000175100017510000000204711723671400016332 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 14; require_ok( 'Module::Install::Metadata' ); my $metadata = Module::Install::Metadata->new; ##################################################################### # Simple Checks my @tests = qw{ 5.1 5.001 5.6 5.006 5.8 5.008 5.10 5.010 5.11 5.011 5.8.8 5.008008 5.10.0 5.010 5.008005 5.008005 }; while ( @tests ) { my $in = shift @tests; my $out = shift @tests; is( $metadata->_perl_version($in), $out, "->_perl_version($in)", ); } ##################################################################### # Practical Approach $metadata->perl_version('5.008'); is($metadata->perl_version, 5.008); $metadata->perl_version('5.8.1'); is($metadata->perl_version, 5.008001); $metadata->perl_version('5.008001'); is($metadata->perl_version, 5.008001); $metadata->perl_version('5.10.1'); is($metadata->perl_version, 5.010001); $metadata->perl_version('5.8'); is($metadata->perl_version, 5.008); Module-Install-1.06/t/13_author_tests_ext.t0000644000175100017510000000743311723671400017230 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; eval "require Module::Install::AuthorTests"; plan skip_all => "requires Module::Install::AuthorTests" if $@; plan tests => 36; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; author_tests 'xt'; WriteAll; END_DSL ok( add_test(qw(xt test.t)), 'added xt' ); ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; ok($content =~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has xt/*.t'); ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t\s+xt\/\*\.t/, 'has no second xt/*.t'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; author_tests 'xt'; WriteAll; END_DSL ok( add_test(qw(xt test.t)), 'added xt' ); ok( build_dist(), 'build_dist' ); rmdir dir(qw(inc .author)); # non-author-mode unlink makefile(); ok( run_makefile_pl(), 'build_dist again' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; if ( $ENV{RELEASE_TESTING} ) { ok($content =~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has xt/*.t'); } else { ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has no xt/*.t'); } ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t\s+xt\/\*\.t/, 'has no second xt/*.t'); ok( kill_dist(), 'kill_dist' ); } # cases with (undocumented) tests_recursive() SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; tests_recursive; author_tests 'xt'; WriteAll; END_DSL ok( add_test(qw(t test.t)), 'added t' ); ok( add_test(qw(xt test.t)), 'added xt' ); ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; ok($content =~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has xt/*.t'); ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t\s+xt\/\*\.t/, 'has no second xt/*.t'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; tests_recursive; author_tests 'xt'; WriteAll; END_DSL ok( add_test(qw(t test.t)), 'added t' ); ok( add_test(qw(xt test.t)), 'added xt' ); ok( build_dist(), 'build_dist' ); rmdir dir(qw(inc .author)); # non-author-mode unlink makefile(); ok( run_makefile_pl(), 'build_dist again' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; if ( $ENV{RELEASE_TESTING} ) { ok($content =~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has xt/*.t'); } else { ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has no xt/*.t'); } ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t\s+xt\/\*\.t/, 'has no second xt/*.t'); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/27_build_requires_and_include.t0000644000175100017510000000350511723671400021170 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use YAML::Tiny; use t::lib::Test; plan tests => 14; SCOPE: { # see if test_requires works correctly ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use strict; use warnings; use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; test_requires 'Test::More' => 9999; WriteAll; END_DSL ok( build_dist, 'build dist' ); my $meta_yml = file('META.yml'); ok(-f $meta_yml, 'has META.yml'); my $meta = YAML::Tiny::LoadFile($meta_yml); ok $meta->{build_requires}{'Test::More'}, 'Test::More is listed in build_requires'; my $makefile = makefile(); ok(-f $makefile, 'has Makefile'); my $content = _read($makefile); ok($content =~ /^#\s+(PREREQ_PM|BUILD_REQUIRES)\s*=>\s*{[^}]+Test::More=>q\[9999\]/m, 'Test::More is listed in PREREQ_PM|BUILD_REQUIRES in Makefile'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { # include removes Test::More from the build_requires in META.yml ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use strict; use warnings; use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; test_requires 'Test::More' => 9999; include 'Test::More'; WriteAll; END_DSL ok( build_dist, 'build dist' ); my $meta_yml = file('META.yml'); ok(-f $meta_yml, 'has META.yml'); my $meta = YAML::Tiny::LoadFile($meta_yml); ok !$meta->{build_requires}{'Test::More'}, 'Test::More is not listed in build_requires'; my $makefile = makefile(); ok(-f $makefile, 'has Makefile'); my $content = _read($makefile); ok($content !~ /^#\s+(PREREQ_PM|BUILD_REQUIRES)\s*=>\s*{[^}]+Test::More=>q\[9999\]/m, 'Test::More is not listed in PREREQ_PM|BUILD_REQUIRES in Makefile'); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/08_dsl.t0000644000175100017510000000324111723671400014403 0ustar adamadam#!/usr/bin/perl # Tests for Module::Install::DSL use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 8; use t::lib::Test; # Load the DSL module require_ok( 'inc::Module::Install::DSL' ); # Generate code from a simple dsl block my $code = Module::Install::DSL::dsl2code(<<'END_DSL'); all_from lib/My/Module.pm requires perl 5.008 requires Carp 0 requires Win32 if win32 test_requires Test::More install_share END_DSL is( $code, <<'END_PERL', 'dsl2code generates the expected code' ); all_from 'lib/My/Module.pm'; requires 'perl', '5.008'; requires 'Carp', '0'; requires 'Win32' if win32; test_requires 'Test::More'; install_share; END_PERL ###################################################################### # Automatic dynamic vs static detection # Automatically set static_config if there are no conditionals my $static = Module::Install::DSL::dsl2code(<<'END_DSL'); all_from lib/My/Module.pm requires perl 5.008 requires Carp 0 requires Win32 test_requires Test::More install_share END_DSL is( $static, <<'END_PERL', 'dsl2code generates the expected code' ); all_from 'lib/My/Module.pm'; requires 'perl', '5.008'; requires 'Carp', '0'; requires 'Win32'; test_requires 'Test::More'; install_share; static_config; END_PERL ##################################################################### # Full scan dist run ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install::DSL 0.81; name Foo version 0.01 license perl requires_from lib/Foo.pm requires File::Spec 0.79 END_DSL ok( build_dist(), 'build_dist' ); ok( -f makefile() ); ok( -f file('META.yml') ); ok( kill_dist(), 'kill_dist' ); Module-Install-1.06/t/23_pl_files.t0000644000175100017510000000572011723671400015417 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; plan tests => 35; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL', <<"END_DSL" }), 'create_dist' ); use strict; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Foo' ); END_DSL ok( add_file('MyFoo.pm.PL', '1;'), 'created .pm.PL'); ok( run_makefile_pl(), 'build_dist' ); my $file = makefile(); ok( -f $file); my $content = _read($file); ok( $content,'file is not empty'); my ($target) = $content =~ /^MyFoo.pm :: (.+)$/m; diag $target if $ENV{TEST_VERBOSE}; ok( $target =~ /^MyFoo.pm.PL pm_to_blib/, 'has MyFoo target' ); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL', <<"END_DSL" }), 'create_dist' ); use strict; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Foo', PL_FILES => { 'MyFoo.pm.PL' => 'MyFoo.pm' }, ); END_DSL ok( add_file('MyFoo.pm.PL', '1;'), 'created .pm.PL'); ok( run_makefile_pl(), 'build_dist' ); my $file = makefile(); ok( -f $file); my $content = _read($file); ok( $content,'file is not empty'); my ($target) = $content =~ /^MyFoo.pm :: (.+)$/m; diag $target if $ENV{TEST_VERBOSE}; ok( $target =~ /^MyFoo.pm.PL pm_to_blib/, 'has MyFoo target' ); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo'), 'create_dist' ); ok( add_file('MyFoo.pm.PL', '1;'), 'created .pm.PL'); ok( run_makefile_pl(), 'build_dist' ); my $file = makefile(); ok( -f $file); my $content = _read($file); ok( $content,'file is not empty'); my ($target) = $content =~ /^MyFoo.pm :: (.+)$/m; diag $target if $ENV{TEST_VERBOSE}; ok( $target =~ /^MyFoo.pm.PL pm_to_blib/, 'has MyFoo target' ); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL', <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; makemaker_args( PL_FILES => { 'MyFoo.pm.PL' => 'MyFoo.pm' }, ); WriteAll; END_DSL ok( add_file('MyFoo.pm.PL', '1;'), 'created .pm.PL'); ok( run_makefile_pl(), 'build_dist' ); my $file = makefile(); ok( -f $file); my $content = _read($file); ok( $content,'file is not empty'); my ($target) = $content =~ /^MyFoo.pm :: (.+)$/m; diag $target if $ENV{TEST_VERBOSE}; ok( $target =~ /^MyFoo.pm.PL pm_to_blib/, 'has MyFoo target' ); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL', <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; WriteMakefile( PL_FILES => { 'MyFoo.pm.PL' => 'MyFoo.pm' }, ); END_DSL ok( add_file('MyFoo.pm.PL', '1;'), 'created .pm.PL'); ok( run_makefile_pl(), 'build_dist' ); my $file = makefile(); ok( -f $file); my $content = _read($file); ok( $content,'file is not empty'); my ($target) = $content =~ /^MyFoo.pm :: (.+)$/m; diag $target if $ENV{TEST_VERBOSE}; ok( $target =~ /^MyFoo.pm.PL pm_to_blib/, 'has MyFoo target' ); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/19_authors.t0000644000175100017510000000531211723671400015311 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use Parse::CPAN::Meta; use t::lib::Test; plan tests => 32; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; author 'ishigaki'; perl_version '5.005'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ author_makefile_re("ishigaki"), 'has one author'); my $metafile = file('META.yml'); ok(-f $metafile); my $meta = Parse::CPAN::Meta::LoadFile($metafile); is_deeply($meta->{author}, [qw(ishigaki)]); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; author 'ishigaki', 'charsbar'; perl_version '5.005'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ author_makefile_re("ishigaki, charsbar"), 'has two authors'); my $metafile = file('META.yml'); ok(-f $metafile); my $meta = Parse::CPAN::Meta::LoadFile($metafile); is_deeply($meta->{author}, [qw(ishigaki charsbar)]); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; authors 'ishigaki', 'charsbar'; perl_version '5.005'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ author_makefile_re("ishigaki, charsbar"), 'has two authors'); my $metafile = file('META.yml'); ok(-f $metafile); my $meta = Parse::CPAN::Meta::LoadFile($metafile); is_deeply($meta->{author}, [qw(ishigaki charsbar)]); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; author 'ishigaki'; author 'charsbar'; perl_version '5.005'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ author_makefile_re("ishigaki, charsbar"), 'has two authors'); my $metafile = file('META.yml'); ok(-f $metafile); my $meta = Parse::CPAN::Meta::LoadFile($metafile); is_deeply($meta->{author}, [qw(ishigaki charsbar)]); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/05_share.t0000644000175100017510000000514411723671400014724 0ustar adamadam#!/usr/bin/perl # Check that install_share use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use t::lib::Test; plan tests => 22; SCOPE: { # normal share dir/file ok( create_dist('Foo', { 'Makefile.PL' => <<'END_DSL' }), 'create_dist' ); use inc::Module::Install 0.82; name 'Foo'; all_from 'lib/Foo.pm'; install_share; WriteAll; END_DSL ok( mkdir(dir('share')), 'mkdir share' ); add_file('share/dist_file.txt', 'sample file'); add_file('MANIFEST', <<'END_MANIFEST'); MANIFEST Makefile.PL lib/Foo.pm share/dist_file.txt END_MANIFEST ok( build_dist(), 'build_dist' ); make(); ok( !$?, 'make' ); my $dir = dir(qw{ blib lib auto share dist Foo }); ok( -d $dir, 'Found install_share in correct dist_dir location' ); my $file = file(qw{ blib lib auto share dist Foo dist_file.txt }); ok( -f $file, 'Found expected file in dist_dir location' ); my $content = _read($file); ok( $content eq 'sample file', 'correct content' ); ok( kill_dist(), 'kill_dist' ); } SCOPE: { # normal share dir, but a file not listed in MANIFEST ok( create_dist('Foo', { 'Makefile.PL' => <<'END_DSL' }), 'create_dist' ); use inc::Module::Install 0.82; name 'Foo'; all_from 'lib/Foo.pm'; install_share; WriteAll; END_DSL ok( mkdir(dir('share')), 'mkdir share' ); add_file('share/dist_file.txt', 'sample file'); add_file('MANIFEST', <<'END_MANIFEST'); MANIFEST Makefile.PL lib/Foo.pm #share/dist_file.txt END_MANIFEST ok( build_dist(), 'build_dist' ); make(); ok( !$?, 'make' ); my $dir = dir(qw{ blib lib auto share dist Foo }); ok( -d $dir, 'Found install_share in correct dist_dir location' ); my $file = file(qw{ blib lib auto share dist Foo dist_file.txt }); ok( !-f $file, 'Found expected file in dist_dir location' ); ok( kill_dist(), 'kill_dist' ); } SCOPE: { # file is listed in MANIFEST, but also in MANIFEST.SKIP ok( create_dist('Foo', { 'Makefile.PL' => <<'END_DSL' }), 'create_dist' ); use inc::Module::Install 0.82; name 'Foo'; all_from 'lib/Foo.pm'; install_share; WriteAll; END_DSL ok( mkdir(dir('share')), 'mkdir share' ); add_file('share/dist_file.txt', 'sample file'); add_file('MANIFEST', <<'END_MANIFEST'); MANIFEST Makefile.PL lib/Foo.pm share/dist_file.txt END_MANIFEST add_file('MANIFEST.SKIP', <<'END_MANIFEST_SKIP'); share/dist_file.txt END_MANIFEST_SKIP ok( build_dist(), 'build_dist' ); make(); ok( !$?, 'make' ); my $dir = dir(qw{ blib lib auto share dist Foo }); ok( -d $dir, 'Found install_share in correct dist_dir location' ); my $file = file(qw{ blib lib auto share dist Foo dist_file.txt }); ok( !-f $file, 'Found expected file in dist_dir location' ); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/11_extraction.t0000644000175100017510000000757611723671400016012 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 16; require_ok( 'Module::Install::Metadata' ); SCOPE: { my @links=Module::Install::Metadata::_extract_bugtracker('L'); is_deeply( \@links, [ 'http://rt.cpan.org/test' ], '1 bugtracker extracted', ) or diag( "bugtrackers: @links" ); } SCOPE: { my @links=Module::Install::Metadata::_extract_bugtracker('L L'); is_deeply( \@links, [ 'http://rt.cpan.org/test1' ], '1 bugtracker extracted (2 links)', ) or diag( "bugtrackers: @links" ); } SCOPE: { my @links=Module::Install::Metadata::_extract_bugtracker('L L'); is_deeply( [ sort @links ], [ 'http://rt.cpan.org/test1', 'http://rt.cpan.org/test2' ], '2 bugtrackers extracted', ) or diag( "bugtrackers: @links" ); } SCOPE: { my @links=Module::Install::Metadata::_extract_bugtracker('L'); is_deeply( \@links, [ ], '0 bugtrackers extracted', ) or diag( "bugtrackers: @links" ); } SCOPE: { my @links=Module::Install::Metadata::_extract_bugtracker('L'); is_deeply( \@links, [ 'http://github.com/marcusramberg/mojomojo/issues' ], '1 bugtracker (github.com) extracted', ) or diag( "bugtrackers: @links" ); } SCOPE: { my @links=Module::Install::Metadata::_extract_bugtracker('L'); is_deeply( \@links, [ 'http://code.google.com/p/www-mechanize/issues/list' ], '1 bugtracker (code.google.com) extracted', ) or diag( "bugtrackers: @links" ); } SCOPE: { my $l=Module::Install::Metadata::_extract_license("=head1 Copyright\nunder the same terms as the perl programming language\n=cut\n"); is($l, 'perl', 'Perl license detected', ); } SCOPE: { my $text="=head1 LICENSE This is free software, you may use it and distribute it under the same terms as Perl itself. =head1 SEE ALSO test =cut "; my $l=Module::Install::Metadata::_extract_license($text); is($l, 'perl', 'Perl license detected', ); } SCOPE: { my $text="=head1 COPYRIGHTS This module is distributed under the same terms as Perl itself. =cut "; my $l=Module::Install::Metadata::_extract_license($text); is($l, 'perl', 'Perl license detected', ); } SCOPE: { my $l=Module::Install::Metadata::_extract_license("=head1 COPYRIGHT\nAs LGPL license\n=cut\n"); is($l, 'lgpl', 'LGPL detected', ); } SCOPE: { my $text=<<'EOT'; =head1 COPYRIGHT AND LICENCE ... is free software; you can redistribute it and/or modify it under the terms of Perl itself, that is to say, under the terms of either: =over 4 =item * The GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or =item * The "Artistic License" which comes with Perl. =back =cut EOT my $l=Module::Install::Metadata::_extract_license($text); is($l, 'perl', 'Perl license detected', ); } SCOPE: { my $text=<<'EOT'; =head1 COPYRIGHT AND LICENCE Copyright (C) 2010 This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://opensource.org/licenses/artistic-license-2.0.php. =cut EOT my $l=Module::Install::Metadata::_extract_license($text); is($l, 'artistic_2', 'Artistic 2.0 license detected', ); } SCOPE: { my $version=Module::Install::Metadata::_extract_perl_version("use 5.10.0;"); is($version, '5.10.0', 'perl 5.10.0 detected', ); } SCOPE: { my $version=Module::Install::Metadata::_extract_perl_version(" use 5.010;"); is($version, '5.010', 'perl 5.10.0 detected', ); } SCOPE: { my $version=Module::Install::Metadata::_extract_perl_version("use strict;"); is($version, undef, 'no perl prereq', ); } Module-Install-1.06/t/22_installdirs.t0000644000175100017510000000474711723671400016161 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use Parse::CPAN::Meta; use t::lib::Test; plan tests => 24; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; makemaker_args 'INSTALLDIRS' => '~/local/'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); my ($installdirs) = $content =~ /^INSTALLDIRS\s*=\s*(.+)$/m; diag "INSTALLDIRS: $installdirs" if $ENV{TEST_VERBOSE}; ok( $installdirs eq '~/local/', 'correct INSTALLDIRS'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; installdirs '~/local/'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); my ($installdirs) = $content =~ /^INSTALLDIRS\s*=\s*(.+)$/m; diag "INSTALLDIRS: $installdirs" if $ENV{TEST_VERBOSE}; ok( $installdirs eq '~/local/', 'correct INSTALLDIRS'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; installdirs '~/local/'; makemaker_args 'INSTALLDIRS' => '~/old/'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); my ($installdirs) = $content =~ /^INSTALLDIRS\s*=\s*(.+)$/m; diag "INSTALLDIRS: $installdirs" if $ENV{TEST_VERBOSE}; ok( $installdirs eq '~/local/', 'correct INSTALLDIRS'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; install_as_core; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); my ($installdirs) = $content =~ /^INSTALLDIRS\s*=\s*(.+)$/m; diag "INSTALLDIRS: $installdirs" if $ENV{TEST_VERBOSE}; ok( $installdirs eq 'perl', 'correct INSTALLDIRS'); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/13_author_tests_ext2.t0000644000175100017510000000711711723671400017311 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; eval "use Module::Install::ExtraTests 0.007"; plan skip_all => "requires Module::Install::ExtraTests 0.007" if $@; plan tests => 38; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; extra_tests; WriteAll; END_DSL ok( add_test(qw(t test.t)), 'added t' ); ok( add_test(qw(xt author test.t)), 'added xt/author' ); ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has no xt/*.t'); my $res = make('test'); ok( $res =~ /Result:\s*PASS/ ); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; extra_tests; WriteAll; END_DSL ok( add_test(qw(t test.t)), 'added t' ); ok( add_test(qw(xt author test.t)), 'added xt/author' ); ok( build_dist(), 'build_dist' ); rmdir dir(qw(inc .author)); # non-author-mode unlink makefile(); ok( run_makefile_pl(), 'build_dist again' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has no xt/*.t'); my $res = make('test'); ok( $res =~ /Result:\s*PASS/ ); ok( kill_dist(), 'kill_dist' ); } # cases with (undocumented) tests_recursive() SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; tests_recursive; extra_tests; WriteAll; END_DSL ok( add_test(qw(t test.t)), 'added t' ); ok( add_test(qw(xt author test.t)), 'added xt/author' ); ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has no xt/*.t'); my $res = make('test'); ok( $res =~ /Result:\s*PASS/ ); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; tests_recursive; extra_tests; WriteAll; END_DSL ok( add_test(qw(t test.t)), 'added t' ); ok( add_test(qw(xt author test.t)), 'added xt/author' ); ok( build_dist(), 'build_dist' ); rmdir dir(qw(inc .author)); # non-author-mode unlink makefile(); ok( run_makefile_pl(), 'build_dist again' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has no xt/*.t'); my $res = make('test'); ok( $res =~ /Result:\s*PASS/ ); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/29_requires_from.t0000644000175100017510000000364211723671400016513 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use t::lib::Test; require ExtUtils::MakeMaker; use vars qw{ $PREREQ_PM $MIN_PERL_VERSION $BUILD_REQUIRES }; plan tests => 19; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; requires_from 'lib/Foo.pm'; WriteAll; END_DSL ok( run_makefile_pl(run_params=>['PREREQ_PRINT >test']), 'build_dist' ); my $file = file('test'); ok( -f $file); my $content = _read($file); ok( $content, 'file is not empty'); ok( $content =~ s/^.*\$PREREQ_PM = \{/\$PREREQ_PM = {/s,'PREREQ_PM found'); eval ($content); ok( !$@,'correct content'); ok( $PREREQ_PM->{'File::Spec'} eq '0.80', 'correct requirement' ); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; test_requires_from 't/test.t'; WriteAll; END_DSL ok( mkdir(dir('t')), 'created t/' ); ok( add_file('t/test.t' => <<'END_TEST'), 'added test'); use strict; use warnings; use Test::More tests => 1; use File::Spec 0.80; ok("ok"); END_TEST ok( run_makefile_pl(run_params=>['PREREQ_PRINT >test']), 'build_dist' ); my $file = file('test'); ok( -f $file); my $content = _read($file); ok( $content, 'file is not empty'); ok( $content =~ s/^.*\$PREREQ_PM = \{/\$PREREQ_PM = {/s,'PREREQ_PM found'); eval ($content); ok( !$@,'correct content'); if ( eval($ExtUtils::MakeMaker::VERSION) < 6.55_03 ) { ok( exists $PREREQ_PM->{'File::Spec'}); ok( !exists $BUILD_REQUIRES->{'File::Spec'}); } else { #best to check both because user can have any version ok( exists $BUILD_REQUIRES->{'File::Spec'}); ok( !exists $PREREQ_PM->{'File::Spec'}); } ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/24_multiple_license_blocks.t0000644000175100017510000000301411723671400020507 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 3; use Module::Install::Metadata; my %p = _setup(); for ( "$p{header}$p{author}$p{copyright}$p{license}$p{footer}", "$p{header}$p{author}$p{license}$p{copyright}$p{footer}", "$p{header}$p{license}$p{author}$p{copyright}$p{footer}", ) { my $license = Module::Install::Metadata::_extract_license($_); ok defined $license && $license eq 'perl', "my license is $license"; } sub _setup { my %parts; $parts{header} =<<'POD'; =head1 NAME Win32::UTCFileTime - Get/set UTC file times with stat/utime on Win32 =head1 SYNOPSIS ... (snip) ... POD $parts{author} = <<'POD'; =head1 AUTHOR Steve Hay Eshay@cpan.orgE POD $parts{copyright} = <<'POD'; =head1 COPYRIGHT Copyright (C) 2003-2007 Steve Hay. All rights reserved. Portions Copyright (C) 2001 Jonathan M Gilligan. Used with permission. Portions Copyright (C) 2001 Tony M Hoyle. Used with permission. POD $parts{copyright} = <<'POD'; =head1 COPYRIGHT Copyright (C) 2003-2007 Steve Hay. All rights reserved. Portions Copyright (C) 2001 Jonathan M Gilligan. Used with permission. Portions Copyright (C) 2001 Tony M Hoyle. Used with permission. POD $parts{license} = <<'POD'; =head1 LICENCE This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e. under the terms of either the GNU General Public License or the Artistic License, as specified in the F file. POD $parts{footer} = <<'POD'; =cut POD return %parts; } Module-Install-1.06/t/26_unknown_func.t0000644000175100017510000000466711723671400016350 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; plan tests => 18; SCOPE: { # runtime error ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use strict; use warnings; use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; unknown_func('args'); warn "after unknown func"; WriteAll; END_DSL if ( supports_capture() ) { my $error = capture_build_dist(); ok $?, 'build fails'; ok( $error =~ /Unknown function is found/, 'correct error'); ok( $error !~ /after unknown func/, 'no bogus warning'); diag $error if $ENV{TEST_VERBOSE}; } else { ok( !build_dist, 'build fails' ); SKIP : { skip 'this platform does not support 2>&1', 2; } } my $file = makefile(); ok(!-f $file, 'Makefile is not created'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { # Bareword not allowed while "strict subs" in use ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use strict; use warnings; use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; unknown_func; warn "after unknown func"; WriteAll; END_DSL if ( supports_capture() ) { my $error = capture_build_dist(); ok $?, 'build fails'; ok( $error =~ /Bareword .+ not allowed/, 'correct error'); ok( $error !~ /after unknown func/, 'no bogus warning'); diag $error if $ENV{TEST_VERBOSE}; } else { ok( !build_dist, 'build fails' ); SKIP : { skip "this platform does not support 2>&1", 2; } } my $file = makefile(); ok(!-f $file, 'Makefile is not created'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { # String found where operator expected ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use strict; use warnings; use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; unknown_func 'args'; warn "after unknown func"; WriteAll; END_DSL if ( supports_capture() ) { my $error = capture_build_dist(); ok $?, 'build fails'; ok( $error =~ /String found where operator expected/, 'correct error'); ok( $error !~ /after unknown func/, 'no bogus warning'); diag $error if $ENV{TEST_VERBOSE}; } else { ok( !build_dist, 'build fails' ); SKIP : { skip "this platform does not support 2>&1", 2; } } my $file = makefile(); ok(!-f $file, 'Makefile is not created'); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/25_perl_version_from.t0000644000175100017510000000221411723671400017351 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; use Parse::CPAN::Meta; plan tests => 36; my @statements = ( 'use 5.005', 'use v5.5.0', 'require 5.005', 'require v5.5.0', ); for my $statement (@statements) { SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; license 'perl'; perl_version_from 'lib/Foo.pm'; WriteAll; END_DSL ok( add_file('lib/Foo.pm', <<"END_PM") ); package Foo; use strict; $statement; 1; END_PM ok( build_dist(), 'build_dist' ); my $file = makefile(); ok( -f $file, 'Makefile exists' ); my $content = _read($file); ok($content, 'file is not empty'); SKIP: { skip 'requires ExtUtils::MakeMaker > 6.48', 1 if eval($ExtUtils::MakeMaker::VERSION) < 6.48; ok($content =~ /#\s*MIN_PERL_VERSION => q\[5\.005\]/, 'has perl_version'); } my $meta = file('META.yml'); ok( -f $meta, 'META.yml exists' ); my $yaml = Parse::CPAN::Meta::LoadFile($meta); is( $yaml->{requires}->{perl}, '5.005', 'META has correct perl version requirement' ); ok( kill_dist(), 'kill_dist' ); }} Module-Install-1.06/t/04_version.t0000644000175100017510000000151311723671400015302 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 24; require_ok( 'inc::Module::Install' ); my @version = qw{ 0 0 1 1 1.1 1.1 1234 1234 1.2_01 1.20001 1.2.3 1.002003 1.2.3_1 1.0020031 5.8.1 5.008001 5.8.10 5.00801 5.10.0 5.01 }; while ( @version ) { my $in = shift @version; my $out = shift @version; my $ver = Module::Install::_version($in); my $two = Module::Install::_version($ver); is( $ver, $out, "$in => $out pass 1 ok" ); is( $two, $out, "$in => $out pass 2 ok" ); } my @cmp = qw{ 0 1.2.3 1.002003 -1 1.2.3 1.002004 1 1.2.3 1.002002 }; while ( @cmp ) { my $want = shift @cmp; my $left = shift @cmp; my $right = shift @cmp; my $have = Module::Install::_cmp(undef, $left, $right); is( $have, $want, "_cmp($left, $right) ok" ); } Module-Install-1.06/t/06_ppport.t0000644000175100017510000000164711723671400015153 0ustar adamadam#!/usr/bin/perl # Check that ppport works use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; eval "require Devel::PPPort"; plan skip_all => 'requires Devel::PPPort' if $@; plan tests => 8; SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = file('ppport.h'); ok( !-f $file, 'Not found ppport.h'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; ppport; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = file('ppport.h'); ok( -f $file, 'Found ppport.h'); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/17_sign.t0000644000175100017510000000257111723671400014566 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; require ExtUtils::MakeMaker; plan skip_all => 'test requires ExtUtils::MakeMaker >= 6.17' if eval($ExtUtils::MakeMaker::VERSION) < 6.17; plan tests => 12; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; WriteAll(sign => 0); END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content !~ /#\s*SIGN => q\[[01]\]/, 'has no sign'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; WriteAll(sign => 1); END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ /#\s*SIGN => q\[1\]/, 'has sign'); # XXX: might be better test `$Config{make} distsign` here # but it's neither safe nor portable... ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/30_build_subdirs.t0000644000175100017510000000427311723671400016454 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use t::lib::Test; use YAML::Tiny; plan tests => 20 * 2; foreach my $command ('', "build_subdirs 'bar';") { SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist Foo'); use inc::Module::Install; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; $command WriteAll; END_DSL ok( mkdir(dir('bar'), 0777), 'created bar directory'); ok( mkdir(dir('bar/lib'), 0777), 'created bar/lib directory'); ok( mkdir(dir('bar/t'), 0777), 'created bar/t directory'); ok( add_file('bar/MANIFEST', <<'END_MANIFEST'), 'created MANIFEST'); MANIFEST Makefile.PL lib/Bar.pm t/load.t END_MANIFEST ok( add_file('bar/Makefile.PL', <<'END_DSL'), 'created Makefile.PL'); use inc::Module::Install; name 'Bar'; abstract 'bar'; author 'foobar'; perl_version '5.005'; version_from 'lib/Bar.pm'; WriteAll; END_DSL ok( add_file('bar/lib/Bar.pm', <<'END_PERL'), 'created Bar.pm'); package Bar; $VERSION = '0.01'; 1; END_PERL ok( add_file('bar/t/load.t', <<'END_T'), 'created load.t'); use Test::More tests => 1; use_ok('Bar'); END_T ok( supports_capture() ? capture_build_dist() : build_dist(), 'build_dist' ); my $makefile_foo = makefile(); ok( -f $makefile_foo, 'has Makefile for Foo' ); my $content_foo = _read($makefile_foo); ok( $content_foo =~ /DISTNAME\s*=>\s*q\[Foo\]/, 'content is correct'); my $meta_yml_foo = file('META.yml'); ok( -f $meta_yml_foo, 'has META.yml for Foo'); my $meta_foo = YAML::Tiny::LoadFile($meta_yml_foo); ok( $meta_foo->{name} eq 'Foo', 'META.yml is correct' ); ok( $meta_foo->{version} eq '3.21', 'META.yml is correct' ); my $makefile_bar = file('bar/Makefile'); ok( -f $makefile_bar, 'has Makefile for Bar' ); my $content_bar = _read($makefile_bar); ok( $content_bar =~ /DISTNAME\s*=>\s*q\[Bar\]/, 'content is correct'); my $meta_yml_bar = file('bar/META.yml'); ok( -f $meta_yml_bar, 'has META.yml for Bar'); my $meta_bar = YAML::Tiny::LoadFile($meta_yml_bar); ok( $meta_bar->{name} eq 'Bar', 'META.yml is correct' ); ok( $meta_bar->{version} eq '0.01', 'META.yml is correct' ); ok( kill_dist(), 'kill_dist' ); } } Module-Install-1.06/t/21_makemaker_args.t0000644000175100017510000001066111723671400016571 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; plan tests => 45; # Let's see how MakeMaker behaves first # normal run SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Foo', INC => '-I/usr/include/', ); END_DSL ok( run_makefile_pl(), 'build_dist' ); my $file = makefile(); ok( -f $file, 'Makefile exists' ); my $content = _read($file); ok( $content,'file is not empty'); my ($inc) = $content =~ /^INC\s*=\s*(.+)$/m; diag "INC: $inc" if $ENV{TEST_VERBOSE}; ok $inc && $inc =~ m{/usr/include/}, "correct INC"; ok( kill_dist(), 'kill_dist' ); } # added as ARGV SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Foo', ); END_DSL ok( run_makefile_pl(run_params => ['INC=-I/usr/opt/include/']), 'build_dist' ); my $file = makefile(); ok( -f $file, 'Makefile exists' ); my $content = _read($file); ok( $content,'file is not empty'); my ($inc) = $content =~ /^INC\s*=\s*(.+)$/m; diag "INC: $inc" if $ENV{TEST_VERBOSE}; ok $inc && $inc =~ m{/usr/opt/include/}, "correct INC"; ok( kill_dist(), 'kill_dist' ); } # combined SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Foo', INC => '-I/usr/include/', ); END_DSL ok( run_makefile_pl(run_params => ['INC=-I/usr/opt/include/']), 'build_dist' ); my $file = makefile(); ok( -f $file, 'Makefile exists' ); my $content = _read($file); ok( $content,'file is not empty'); my ($inc) = $content =~ /^INC\s*=\s*(.+)$/m; diag "INC: $inc" if $ENV{TEST_VERBOSE}; ok $inc && $inc !~ m{/usr/include/}, "INC is overriden"; ok $inc && $inc =~ m{/usr/opt/include/}, "correct INC"; ok( kill_dist(), 'kill_dist' ); } # Now test Module::Install # normal run SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; cc_inc_paths '/usr/include/'; WriteAll; END_DSL ok( run_makefile_pl(), 'build_dist' ); my $file = makefile(); ok( -f $file, 'Makefile exists' ); my $content = _read($file); ok( $content,'file is not empty'); my ($inc) = $content =~ /^INC\s*=\s*(.+)$/m; diag "INC: $inc" if $ENV{TEST_VERBOSE}; ok $inc && $inc =~ m{/usr/include/}, "correct INC"; ok( kill_dist(), 'kill_dist' ); } # multiple inc paths SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; cc_inc_paths '/usr/include/'; cc_inc_paths '/usr/opt/include/'; WriteAll; END_DSL ok( run_makefile_pl(), 'build_dist' ); my $file = makefile(); ok( -f $file, 'Makefile exists' ); my $content = _read($file); ok( $content,'file is not empty'); my ($inc) = $content =~ /^INC\s*=\s*(.+)$/m; diag "INC: $inc" if $ENV{TEST_VERBOSE}; ok $inc && $inc =~ m{/usr/include/}, "correct INC"; ok $inc && $inc =~ m{/usr/opt/include/}, "correct INC"; ok( kill_dist(), 'kill_dist' ); } # added as ARGV SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( run_makefile_pl(run_params => ['INC=-I/usr/opt/include/']), 'build_dist' ); my $file = makefile(); ok( -f $file, 'Makefile exists' ); my $content = _read($file); ok( $content,'file is not empty'); my ($inc) = $content =~ /^INC\s*=\s*(.+)$/m; diag "INC: $inc" if $ENV{TEST_VERBOSE}; ok $inc && $inc =~ m{/usr/opt/include/}, "correct INC"; ok( kill_dist(), 'kill_dist' ); } # combined SCOPE: { ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; cc_inc_paths '/usr/include/'; WriteAll; END_DSL ok( run_makefile_pl(run_params => ['INC=-I/usr/opt/include/']), 'build_dist' ); my $file = makefile(); ok( -f $file, 'Makefile exists' ); my $content = _read($file); ok( $content,'file is not empty'); my ($inc) = $content =~ /^INC\s*=\s*(.+)$/m; diag "INC: $inc" if $ENV{TEST_VERBOSE}; ok $inc && $inc !~ m{/usr/include/}, "INC is overriden"; ok $inc && $inc =~ m{/usr/opt/include/}, "correct INC"; ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/02_mymeta.t0000644000175100017510000000231711723671400015112 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } require ExtUtils::MakeMaker; my $eumm = eval $ExtUtils::MakeMaker::VERSION; use Test::More; if ( $eumm < 6.5702 ) { plan( tests => 24 ); } else { plan( skip_all => 'New EU::MM has own MYMETA support' ); } use File::Spec; use t::lib::Test; # Regular build SCOPE: { ok( create_dist('Foo'), 'create_dist' ); ok( build_dist(), 'build_dist' ); ok( -f makefile() ); ok( -f file('META.yml') ); ok( ! -f file('MYMETA.yml') ); ok( ! -f file('MYMETA.json') ); ok( -f file(qw(inc Module Install.pm)) ); ok( kill_dist(), 'kill_dist' ); } # MYMETA.yml build SCOPE: { ok( create_dist('Foo'), 'create_dist' ); ok( build_dist( MYMETA => 'YAML' ), 'build_dist' ); ok( -f makefile() ); ok( -f file('META.yml') ); ok( -f file('MYMETA.yml') ); ok( ! -f file('MYMETA.json') ); ok( -f file(qw(inc Module Install.pm)) ); ok( kill_dist(), 'kill_dist' ); } # MYMETA.json build SCOPE: { ok( create_dist('Foo'), 'create_dist' ); ok( build_dist( MYMETA => 'JSON' ), 'build_dist' ); ok( -f makefile() ); ok( -f file('META.yml') ); ok( ! -f file('MYMETA.yml') ); ok( -f file('MYMETA.json') ); ok( -f file(qw(inc Module Install.pm)) ); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/31_add_metadata.t0000644000175100017510000000113011723671400016200 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use t::lib::Test; use YAML::Tiny; plan tests => 5; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist Foo'); use inc::Module::Install; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; add_metadata 'x_foo' => 'bar'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = file('META.yml'); ok( -f $file); my $yaml = YAML::Tiny::LoadFile($file); ok( $yaml->{x_foo} && $yaml->{x_foo} eq 'bar' ); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/13_author_tests.t0000644000175100017510000000315311723671400016343 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; plan tests => 15; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; WriteAll; END_DSL ok( add_test(qw(xt test.t)), 'added xt' ); ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; ok($content =~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has xt/*.t'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; WriteAll; END_DSL ok( add_test(qw(xt test.t)), 'added xt' ); ok( build_dist(), 'build_dist' ); rmdir dir(qw(inc .author)); # non-author-mode unlink makefile(); ok( run_makefile_pl(), 'build_dist again' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); diag my ($testline) = $content =~ /^#\s*(test => .+)$/m if $ENV{TEST_VERBOSE}; if ( $ENV{RELEASE_TESTING} ) { ok($content =~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has xt/*.t'); } else { ok($content !~ /#\s*test => { TESTS=>.+xt\/\*\.t/, 'has no xt/*.t'); } ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/18_all_from.t0000644000175100017510000000331611723671400015420 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; require ExtUtils::MakeMaker; my $eumm = eval $ExtUtils::MakeMaker::VERSION; plan tests => 18; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ /#\s*ABSTRACT => q\[A test module\]/, 'has abstract'); ok($content =~ author_makefile_re("Foo Bar"), 'has author'); ok($content =~ /#\s*VERSION => q\[3\.21\]/, 'has version'); SKIP: { skip "requires ExtUtils::MakeMaker 6.31", 1 unless $eumm < 6.31; ok($content =~ /#\s*LICENSE => q\[perl\]/, 'has license'); } ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; abstract 'overriden abstract'; author 'Bar Foo'; version '0.01'; license 'MIT'; all_from 'lib/Foo.pm'; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file = makefile(); ok(-f $file); my $content = _read($file); ok($content, 'file is not empty'); ok($content =~ /#\s*ABSTRACT => q\[overriden abstract\]/, 'has abstract'); ok($content =~ author_makefile_re("Bar Foo"), 'has author'); ok($content =~ /#\s*VERSION => q\[0\.01\]/, 'has version'); SKIP: { skip "requires ExtUtils::MakeMaker 6.31", 1 if $eumm < 6.31; ok($content =~ /#\s*LICENSE => q\[mit\]/, 'has license'); } ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/lib/0000755000175100017510000000000011723672002013672 5ustar adamadamModule-Install-1.06/t/lib/Test.pm0000644000175100017510000001256311723671400015157 0ustar adamadampackage t::lib::Test; use strict; use File::Spec (); use File::Remove (); use File::Path (); use Cwd; use Config; use vars qw{$VERSION @ISA @EXPORT $DIST}; BEGIN { $VERSION = '1.06'; @ISA = 'Exporter'; @EXPORT = qw{ create_dist build_dist kill_dist run_makefile_pl add_file add_test _read file dir makefile make supports_capture capture_build_dist author_makefile_re }; $DIST = ''; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_NEW sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_OLD sub create_dist { $DIST = shift; my $opt = shift || {}; # Clear out any existing directory kill_dist( $DIST ); my $home = cwd; my $dist_path = dir(); my $dist_lib = dir('lib'); mkdir($dist_path, 0777) or return 0; mkdir($dist_lib, 0777) or return 0; chdir($dist_path ) or return 0; # Write the MANIFEST open( MANIFEST, '>MANIFEST' ) or return 0; print MANIFEST $opt->{MANIFEST} || <<"END_MANIFEST"; MANIFEST Makefile.PL lib/$DIST.pm END_MANIFEST close MANIFEST; # Write the configure script open MAKEFILE_PL, '>Makefile.PL' or return 0; print MAKEFILE_PL $opt->{'Makefile.PL'} || <<"END_MAKEFILE_PL"; use inc::Module::Install 0.81; name '$DIST'; version '0.01'; license 'perl'; requires_from 'lib/$DIST.pm'; requires 'File::Spec' => '0.79'; WriteAll; END_MAKEFILE_PL close MAKEFILE_PL; # Write the module file open MODULE, ">lib/$DIST.pm" or return 0; print MODULE $opt->{"lib/$DIST.pm"} || <<"END_MODULE"; package $DIST; =pod =head1 NAME $DIST - A test module =cut use 5.005; use strict; \$VERSION = '3.21'; use File::Spec 0.80; =pod =head1 AUTHORS Foo Bar =cut 1; __END__ =head1 COPYRIGHT This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut END_MODULE close MODULE; chdir $home or return 0; return 1; } sub file { File::Spec->catfile('t', $DIST . $$, @_) } sub dir { File::Spec->catdir('t', $DIST . $$, @_) } sub makefile { file(@_, $^O eq 'VMS' ? 'Descrip.MMS' : 'Makefile' ) } sub add_file { my $dist_path = dir(); return 0 unless -d $dist_path; my $content = pop; my $file = pop; my @subdir = @_; my $dist_subdir = dir(@subdir); my $dist_file = file(@subdir, $file); unless (-d $dist_subdir) { File::Path::mkpath($dist_subdir, 0, 0777) or return 0; } open FILE, "> $dist_file" or return 0; print FILE $content; close FILE; return 1; } sub add_test { add_file(@_, qq{print "1..1\nok 1\n";}) } sub build_dist { my %params = @_; my $dist_path = dir(); return 0 unless -d $dist_path; my $home = cwd; chdir $dist_path or return 0; my $X_MYMETA = $params{MYMETA} || ''; local $ENV{X_MYMETA} = $X_MYMETA; my @run_params=@{ $params{run_params} || [] }; my $ret = system($^X, "-I../../lib", "-I../../blib/lib", "Makefile.PL",@run_params); chdir $home or return 0; return $ret ? 0 : 1; } sub run_makefile_pl { my %params = @_; my $dist_path = dir(); return 0 unless -d $dist_path; my $home = cwd; chdir $dist_path or return 1; my $X_MYMETA = $params{MYMETA} || ''; local $ENV{X_MYMETA} = $X_MYMETA; my $run_params=join(' ',@{ $params{run_params} || [] }); my $ret = system("$^X -I../../lib -I../../blib/lib Makefile.PL $run_params"); #my $result=qx(); chdir $home or return 0; return $ret ? 0 : 1; } sub kill_dist { my $dir = dir(); return 1 unless -d $dir; File::Remove::remove( \1, $dir ); return -d $dir ? 0 : 1; } sub supports_capture { # stolen from ExtUtils::MakeMaker's test use ExtUtils::MM; # Unix, modern Windows and OS/2 from 5.005_54 up can handle 2>&1 # This makes our failure diagnostics nicer to read. return 1 if (MM->os_flavor_is('Unix') or (MM->os_flavor_is('Win32') and !MM->os_flavor_is('Win9x')) or ($] > 5.00554 and MM->os_flavor_is('OS/2'))); } sub capture_build_dist { my %params = @_; my $dist_path = dir(); return '' unless -d $dist_path; my $home = cwd; chdir $dist_path or return ''; my $X_MYMETA = $params{MYMETA} || ''; local $ENV{X_MYMETA} = $X_MYMETA; my @run_params=@{ $params{run_params} || [] }; my $command = join ' ', $^X, "-I../../lib", "-I../../blib/lib", "Makefile.PL", @run_params; my $ret = `$command 2>&1`; chdir $home; return $ret; } sub extract_target { my $target = shift; my $makefile = makefile(); return '' unless -f $makefile; my $content = _read($makefile) or return ''; my @lines; my $flag; foreach (split /\n/, $content) { if (/^$target\s*:/) { $flag++ } elsif (/^\S+\s*:/) { $flag = 0 } push @lines, $_ if $flag; } return wantarray ? @lines : join "\n", @lines; } sub make { my $target = shift || ''; my $dist_path = dir(); return '' unless -d $dist_path; my $home = cwd; chdir $dist_path or return ''; my $make = $Config{make}; my $ret = supports_capture() ? `$make $target 2>&1` : `$make $target`; chdir $home; return $ret; } require ExtUtils::MakeMaker; my $eumm = eval $ExtUtils::MakeMaker::VERSION; sub author_makefile_re { my $author=shift; if ($eumm>=6.5702) { return qr/#\s*AUTHOR => \[q\[$author\]\]/; } else { return qr/#\s*AUTHOR => q\[$author\]/; } } 1; Module-Install-1.06/t/recursive/0000755000175100017510000000000011723672002015133 5ustar adamadamModule-Install-1.06/t/recursive/test.t0000644000175100017510000000012711723671400016300 0ustar adamadam#!/usr/bin/perl print "1..1\n"; print "ok - tests_recursive called test in subdir\n"; Module-Install-1.06/t/01_compile.t0000644000175100017510000000260611723671400015246 0ustar adamadam#!/usr/bin/perl # Compile testing for Module::Install use strict; BEGIN { $| = 1; $^W = 1; } use Test::More tests => 68; # Check their perl version ok( $] >= 5.005, "Your perl is new enough" ); # Load the test class use_ok( 't::lib::Test' ); my @classes = qw{ Module::Install::Base Module::Install::Admin Module::Install::AutoInstall Module::Install::Bundle Module::Install::Can Module::Install::Compiler Module::Install::Deprecated Module::Install::DSL Module::Install::External Module::Install::Fetch Module::Install::Include Module::Install::Inline Module::Install::Makefile Module::Install::MakeMaker Module::Install::Metadata Module::Install::PAR Module::Install::Run Module::Install::Scripts Module::Install::Share Module::Install::Win32 Module::Install::With Module::Install::WriteAll Module::Install::Admin::Bundle Module::Install::Admin::Compiler Module::Install::Admin::Find Module::Install::Admin::Include Module::Install::Admin::Makefile Module::Install::Admin::Manifest Module::Install::Admin::Metadata Module::Install::Admin::ScanDeps Module::Install::Admin::WriteAll Module::Install inc::Module::Install }; # Load each class and check VERSIONs foreach my $class ( @classes ) { eval "require $class;"; ok( ! $@, "$class loads ok" ); no strict 'refs'; is( ${"${class}::VERSION"}, $t::lib::Test::VERSION, "$class \$VERSION matches" ); } Module-Install-1.06/t/03_autoinstall.t0000644000175100017510000000335211723671400016156 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 0; } use Test::More; BEGIN { if ( $ENV{RELEASE_TESTING} ) { plan( tests => 6 ); } else { plan( skip_all => 'Skipping dangerous test' ); exit(0); } } # Intercepts calls to WriteMakefile and prompt. my $mm_args; my @prompts = qw/y n n y y/; use ExtUtils::MakeMaker; sub ExtUtils::MakeMaker::WriteMakefile { $mm_args = {@_} } sub ExtUtils::MakeMaker::prompt ($;$) { return 'n' } # tiehandle trick to intercept STDOUT. sub PRINT { my $self = shift; $$self .= join '', @_; } sub PRINTF { my $self = shift; $$self .= sprintf(shift, @_); } sub TIEHANDLE { my $self = ''; return bless \$self, shift; } sub READ {} sub READLINE {} sub GETC {} sub FILENO {} require Symbol; my $fh = Symbol::gensym; my $out = tie *$fh, __PACKAGE__; select(*$fh); # test from a clean state $ENV{PERL_AUTOINSTALL} = ''; require Module::AutoInstall; Module::AutoInstall::_accept_default(0); *Module::AutoInstall::_prompt = sub { ok($_[1], shift(@prompts)); return 'n'; }; # calls the module. my $rv = eval <<'.'; use Module::AutoInstall ( -version => '0.21', # Module::AutoInstall version -config => { make_args => '--hello' # option(s) for CPAN::Config }, -core => [ # core modules Package0 => '', # any version would do ], 'Feature1' => [ # do we want to install this feature by default? -default => 0, Package1 => '0.01', ], 'Feature2' => [ # associate tests to be disabled along with this -tests => [ $0 ], Package2 => '0.02', ], 'Feature3' => { # hash reference works, too Package3 => '0.03', }, ); ''; . is($rv, ''); Module-Install-1.06/t/28_makemaker_args.t0000644000175100017510000000125411723671400016576 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; plan tests => 6; SCOPE: { # PREOP/POSTOP ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; perl_version '5.005'; all_from 'lib/Foo.pm'; makemaker_args(dist => { PREOP => 'my_preop', POSTOP => 'my_postop', }); WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $makefile = makefile(); ok(-f $makefile, 'has Makefile'); my $content = _read($makefile); ok( $content =~ /my_preop/, 'has PREOP' ); ok( $content =~ /my_postop/, 'has POSTOP' ); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/15_wrong_usage.t0000644000175100017510000000143211723671400016137 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; plan tests => 4; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use Module::Install 0.81; # should use "use inc::Module::Install"! name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; WriteAll; END_DSL if ( supports_capture() ) { my $error = capture_build_dist(); ok $?, 'build failed'; ok $error =~ /Please invoke Module::Install with/, 'correct error'; diag $error if $ENV{TEST_VERBOSE}; } else { ok !build_dist(), "build_dist failed"; SKIP: { skip 'this platform does not support 2>&1', 1; } } ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/14_auto_include_deps_with_version.t0000644000175100017510000000257311723671400022113 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; require ExtUtils::MakeMaker; use vars qw{ $PREREQ_PM $MIN_PERL_VERSION $BUILD_REQUIRES }; plan skip_all => 'your perl is new enough to have File::Spec 3.30 in core' if $] > 5.010000; plan skip_all => 'your File::Spec is not new enough for this test' if $File::Spec::VERSION < 3.30; plan tests => 8; SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; test_requires 'File::Spec' => 0.6; auto_include_deps; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file_spec = file(qw(inc File Spec.pm)); ok( !-f $file_spec, 'File::Spec is not included'); ok( kill_dist(), 'kill_dist' ); } SCOPE: { ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' ); use inc::Module::Install 0.81; name 'Foo'; version '0.01'; author 'Someone'; license 'perl'; perl_version '5.005'; requires_from 'lib/Foo.pm'; test_requires 'File::Spec' => 3.30; auto_include_deps; WriteAll; END_DSL ok( build_dist(), 'build_dist' ); my $file_spec = file(qw(inc File Spec.pm)); ok( -f $file_spec, 'File::Spec is included'); ok( kill_dist(), 'kill_dist' ); } Module-Install-1.06/t/16_require.t0000644000175100017510000000041711723671400015276 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; plan tests => 1; SCOPE: { eval "require Module::Install"; ok !$@, "import succeeds: \$Module::Install::VERSION $Module::Install::VERSION"; diag $@ if $@; } Module-Install-1.06/t/09_read.t0000644000175100017510000000151511723671400014537 0ustar adamadam#!/usr/bin/perl use strict; BEGIN { $| = 1; $^W = 1; } use Test::More; use File::Spec; use t::lib::Test; plan tests => 7; SCOPE: { ok( create_dist('Foo'), 'create_dist' ); ok( build_dist(), 'built dist' ); require_ok( file('inc/Module/Install.pm') ); my $file = file('lib/Foo.pm'); ok( -f $file, "Found test file '$file'" ); my $pod = Module::Install::_readpod($file); is($pod, <<'END_POD', "_readpod($file)" ); =head1 NAME Foo - A test module =head1 AUTHORS Foo Bar =head1 COPYRIGHT This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. END_POD my $perl = Module::Install::_readperl($file); is($perl, <<'END_PERL', "_readperl($file)" ); package Foo; use 5.005; use strict; $VERSION = '3.21'; use File::Spec 0.80; 1; END_PERL ok( kill_dist(), 'kill dist' ); } Module-Install-1.06/lib/0000755000175100017510000000000011723672002013427 5ustar adamadamModule-Install-1.06/lib/inc/0000755000175100017510000000000011723672002014200 5ustar adamadamModule-Install-1.06/lib/inc/Module/0000755000175100017510000000000011723672002015425 5ustar adamadamModule-Install-1.06/lib/inc/Module/Install.pm0000644000175100017510000001241011723671400017370 0ustar adamadampackage inc::Module::Install; # This module ONLY loads if the user has manually installed their own # installation of Module::Install, and are some form of MI author. # # It runs from the installed location, and is never bundled # along with the other bundled modules. # # So because the version of this differs from the version that will # be bundled almost every time, it doesn't have it's own version and # isn't part of the synchronisation-checking. use strict; use vars qw{$VERSION}; BEGIN { # While this version will be overwritten when Module::Install # loads, it remains so Module::Install itself can detect which # version an author currently has installed. # This allows it to implement any back-compatibility features # it may want or need to. $VERSION = '1.06'; } if ( -d './inc' ) { my $author = $^O eq 'VMS' ? './inc/_author' : './inc/.author'; if ( -d $author ) { my $modified_at = (stat($author))[9]; if ((time - $modified_at) > 24 * 60 * 60) { # inc is a bit stale; there may be a newer Module::Install _check_update($modified_at); } $Module::Install::AUTHOR = 1; require File::Path; File::Path::rmtree('inc'); } } else { $Module::Install::AUTHOR = 1; } unshift @INC, 'inc' unless $INC[0] eq 'inc'; local $^W; require Module::Install; sub _check_update { my $modified_at = shift; # XXX: We have several online services to get update information # including search.cpan.org. They are more reliable than the # 02packages.details.txt.gz on the local machine. We might be # better to depend on those services... but on which? my $cpan_version = 0; if (0) { # XXX: should be configurable? my $url = "http://search.cpan.org/dist/Module-Install/META.yml"; eval "require YAML::Tiny; 1" or return; if (eval "require LWP::UserAgent; 1") { my $ua = LWP::UserAgent->new( timeout => 10, env_proxy => 1, ); my $res = $ua->get($url); return unless $res->is_success; my $yaml = eval { YAML::Tiny::Load($res->content) } or return; $cpan_version = $yaml->{version}; } } else { # If you don't want to rely on the net... require File::Spec; $cpan_version = _check_update_local($modified_at) or return; } # XXX: should die instead of warn? warn <<"WARN" if $cpan_version > $VERSION; Newer version of Module::Install is available on CPAN. CPAN: $cpan_version LOCAL: $VERSION Please upgrade. WARN } sub _check_update_local { my $modified_at = shift; return unless eval "require Compress::Zlib; 1"; _require_myconfig_or_config() or return; my $file = File::Spec->catfile( $CPAN::Config->{keep_source_where}, 'modules', '02packages.details.txt.gz' ); return unless -f $file; # return if (stat($file))[9] < $modified_at; my $gz = Compress::Zlib::gzopen($file, 'r') or return; my $line; while($gz->gzreadline($line)) { my ($cpan_version) = $line =~ /^Module::Install\s+(\S+)/ or next; return $cpan_version; } return; } # adapted from CPAN::HandleConfig sub _require_myconfig_or_config { return 1 if $INC{"CPAN/MyConfig.pm"}; local @INC = @INC; my $home = _home() or return; my $cpan_dir = File::Spec->catdir($home,'.cpan'); return unless -d $cpan_dir; unshift @INC, $cpan_dir; eval { require CPAN::MyConfig }; if ($@ and $@ !~ m#locate CPAN/MyConfig\.pm#) { warn "Error while requiring CPAN::MyConfig:\n$@\n"; return; } return 1 if $INC{"CPAN/MyConfig.pm"}; eval { require CPAN::Config; }; if ($@ and $@ !~ m#locate CPAN/Config\.pm#) { warn "Error while requiring CPAN::Config:\n$@\n"; return; } return 1 if $INC{"CPAN/Config.pm"}; return; } # adapted from CPAN::HandleConfig sub _home () { my $home; if (eval "require File:HomeDir; 1") { $home = File::HomeDir->can('my_dot_config') ? File::HomeDir->my_dot_config : File::HomeDir->my_data; unless (defined $home) { $home = File::HomeDir->my_home } } unless (defined $home) { $home = $ENV{HOME}; } $home; } 1; __END__ =pod =head1 NAME inc::Module::Install - Module::Install configuration system =head1 SYNOPSIS use inc::Module::Install; =head1 DESCRIPTION This module first checks whether the F directory exists, and removes the whole F directory if it does, so the module author always get a fresh F every time they run F. Next, it unshifts C into C<@INC>, then loads B from there. Below is an explanation of the reason for using a I: The original implementation of B introduces subtle problems for distributions ending with C (e.g. B, B), because its placement in F<./CPAN/> duplicates the real libraries that will get installed; also, the directory name F<./CPAN/> may confuse users. On the other hand, putting included, for-build-time-only libraries in F<./inc/> is a normal practice, and there is little chance that a CPAN distribution will be called C, so it's much safer to use. Also, it allows for other helper modules like B to reside also in F, and to make use of them. =head1 AUTHORS Audrey Tang Eautrijus@autrijus.orgE =head1 COPYRIGHT Copyright 2003, 2004 Audrey Tang Eautrijus@autrijus.orgE. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L =cut Module-Install-1.06/lib/inc/Module/Install/0000755000175100017510000000000011723672002017033 5ustar adamadamModule-Install-1.06/lib/inc/Module/Install/DSL.pm0000644000175100017510000000563611723671400020026 0ustar adamadampackage inc::Module::Install::DSL; # This module ONLY loads if the user has manually installed their own # installation of Module::Install, and are some form of MI author. # # It runs from the installed location, and is never bundled # along with the other bundled modules. # # So because the version of this differs from the version that will # be bundled almost every time, it doesn't have it's own version and # isn't part of the synchronisation-checking. use strict; use vars qw{$VERSION}; BEGIN { # While this version will be overwritten when Module::Install # loads, it remains so Module::Install itself can detect which # version an author currently has installed. # This allows it to implement any back-compatibility features # it may want or need to. $VERSION = '1.06'; } if ( -d './inc' ) { my $author = $^O eq 'VMS' ? './inc/_author' : './inc/.author'; if ( -d $author ) { $Module::Install::AUTHOR = 1; require File::Path; File::Path::rmtree('inc'); } } else { $Module::Install::AUTHOR = 1; } unshift @INC, 'inc' unless $INC[0] eq 'inc'; require inc::Module::Install; require Module::Install::DSL; # Tie our import to the main one sub import { goto &Module::Install::DSL::import; } 1; =pod =head1 NAME inc::Module::Install::DSL - Domain Specific Language for Module::Install =head1 SYNOPSIS use inc::Module::Install::DSL 0.80; all_from lib/ADAMK/Repository.pm requires File::Spec 3.29 requires File::pushd 1.00 requires File::Find::Rule 0.30 requires File::Find::Rule::VCS 1.05 requires File::Flat 0 requires File::Remove 1.42 requires IPC::Run3 0.034 requires Object::Tiny 1.06 requires Params::Util 0.35 requires CPAN::Version 5.5 test_requires Test::More 0.86 test_requires Test::Script 1.03 install_script adamk requires_external_bin svn =head1 DESCRIPTION One of the primary design goals of L is to simplify the creation of F scripts. Part of this involves the gradual reduction of any and all superfluous characters, with the ultimate goal of requiring no non-critical information in the file. L is a simple B based on the already-lightweight L command syntax. The DSL takes one command on each line, and then wraps the command (and its parameters) with the normal quotes and semi-colons etc to turn it into Perl code. =head1 SUPPORT Bugs should be reported via the CPAN bug tracker at L For other issues contact the author. =head1 AUTHORS Adam Kennedy Eadamk@cpan.orgE =head1 COPYRIGHT Copyright 2008 - 2012 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Module-Install-1.06/lib/Module/0000755000175100017510000000000011723672002014654 5ustar adamadamModule-Install-1.06/lib/Module/Install.pm0000644000175100017510000003012511723671400016622 0ustar adamadampackage Module::Install; # For any maintainers: # The load order for Module::Install is a bit magic. # It goes something like this... # # IF ( host has Module::Install installed, creating author mode ) { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install # 3. The installed version of inc::Module::Install loads # 4. inc::Module::Install calls "require Module::Install" # 5. The ./inc/ version of Module::Install loads # } ELSE { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install # 3. The ./inc/ version of Module::Install loads # } use 5.005; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); use vars qw{$VERSION $MAIN}; BEGIN { # All Module::Install core packages now require synchronised versions. # This will be used to ensure we don't accidentally load old or # different versions of modules. # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. $VERSION = '1.06'; # Storage for the pseudo-singleton $MAIN = undef; *inc::Module::Install::VERSION = *VERSION; @inc::Module::Install::ISA = __PACKAGE__; } sub import { my $class = shift; my $self = $class->new(@_); my $who = $self->_caller; #------------------------------------------------------------- # all of the following checks should be included in import(), # to allow "eval 'require Module::Install; 1' to test # installation of Module::Install. (RT #51267) #------------------------------------------------------------- # Whether or not inc::Module::Install is actually loaded, the # $INC{inc/Module/Install.pm} is what will still get set as long as # the caller loaded module this in the documented manner. # If not set, the caller may NOT have loaded the bundled version, and thus # they may not have a MI version that works with the Makefile.PL. This would # result in false errors or unexpected behaviour. And we don't want that. my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; unless ( $INC{$file} ) { die <<"END_DIE" } Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; END_DIE # This reportedly fixes a rare Win32 UTC file time issue, but # as this is a non-cross-platform XS module not in the core, # we shouldn't really depend on it. See RT #24194 for detail. # (Also, this module only supports Perl 5.6 and above). eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006; # If the script that is loading Module::Install is from the future, # then make will detect this and cause it to re-run over and over # again. This is bad. Rather than taking action to touch it (which # is unreliable on some platforms and requires write permissions) # for now we should catch this and refuse to run. if ( -f $0 ) { my $s = (stat($0))[9]; # If the modification time is only slightly in the future, # sleep briefly to remove the problem. my $a = $s - time; if ( $a > 0 and $a < 5 ) { sleep 5 } # Too far in the future, throw an error. my $t = time; if ( $s > $t ) { die <<"END_DIE" } Your installer $0 has a modification time in the future ($s > $t). This is known to create infinite loops in make. Please correct this, then run $0 again. END_DIE } # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. It was impossible to maintain duel backends, and has been deprecated. Please remove all Build.PL files and only use the Makefile.PL installer. END_DIE #------------------------------------------------------------- # To save some more typing in Module::Install installers, every... # use inc::Module::Install # ...also acts as an implicit use strict. $^H |= strict::bits(qw(refs subs vars)); #------------------------------------------------------------- unless ( -f $self->{file} ) { foreach my $key (keys %INC) { delete $INC{$key} if $key =~ /Module\/Install/; } local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{'inc/Module/Install.pm'}; delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; return 1; } sub autoload { my $self = shift; my $who = $self->_caller; my $cwd = Cwd::cwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = Cwd::cwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } unless ($$sym =~ s/([^:]+)$//) { # XXX: it looks like we can't retrieve the missing function # via $$sym (usually $main::AUTOLOAD) in this case. # I'm still wondering if we should slurp Makefile.PL to # get some context or not ... my ($package, $file, $line) = caller; die <<"EOT"; Unknown function is found at $file line $line. Execution of $file aborted due to runtime errors. If you're a contributor to a project, you may need to install some Module::Install extensions from CPAN (or other repository). If you're a user of a module, please contact the author. EOT } my $method = $1; if ( uc($method) eq $method ) { # Do nothing return; } elsif ( $method =~ /^_/ and $self->can($method) ) { # Dispatch to the root M:I class return $self->$method(@_); } # Dispatch to the appropriate plugin unshift @_, ( $self, $1 ); goto &{$self->can('call')}; }; } sub preload { my $self = shift; unless ( $self->{extensions} ) { $self->load_extensions( "$self->{prefix}/$self->{path}", $self ); } my @exts = @{$self->{extensions}}; unless ( @exts ) { @exts = $self->{admin}->load_all_extensions; } my %seen; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless $obj->can($method); next if $method =~ /^_/; next if $method eq uc($method); $seen{$method}++; } } my $who = $self->_caller; foreach my $name ( sort keys %seen ) { local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; delete $INC{'FindBin.pm'}; { # to suppress the redefine warning local $SIG{__WARN__} = sub {}; require FindBin; } # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ( $args{path} ) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; $args{wrote} = 0; bless( \%args, $class ); } sub call { my ($self, $method) = @_; my $obj = $self->load($method) or return; splice(@_, 0, 2, $obj); goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die <<"END_DIE"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END_DIE my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top) = @_; my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find( sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; return if lc($subpath) eq lc($self->{dispatch}); $file = "$self->{path}/$subpath.pm"; my $pkg = "$self->{name}::$subpath"; $pkg =~ s!/!::!g; # If we have a mixed-case package name, assume case has been preserved # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($subpath . '.pm'); my $in_pod = 0; foreach ( split //, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text next if /^\s*#/; # and comments if ( m/^\s*package\s+($pkg)\s*;/i ) { $pkg = $1; last; } } } push @found, [ $file, $pkg ]; }, $path ) if -d $path; @found; } ##################################################################### # Common Utility Functions sub _caller { my $depth = 0; my $call = caller($depth); while ( $call eq __PACKAGE__ ) { $depth++; $call = caller($depth); } return $call; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_NEW sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_OLD sub _readperl { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; return $string; } sub _readpod { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; return $string if $_[0] =~ /\.pod\z/; $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; $string =~ s/^\n+//s; return $string; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_NEW sub _write { local *FH; open( FH, "> $_[0]" ) or die "open($_[0]): $!"; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_OLD # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). sub _version ($) { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { # Normalise multipart versions $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; } $s =~ s/^(\d+)\.?//; my $l = $1 || 0; my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g; $l = $l . '.' . join '', @v if @v; return $l + 0; } sub _cmp ($$) { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS sub _CLASS ($) { ( defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s ) ? $_[0] : undef; } 1; # Copyright 2008 - 2012 Adam Kennedy. Module-Install-1.06/lib/Module/Install.pod0000644000175100017510000006175111723671400017001 0ustar adamadam=pod =head1 NAME Module::Install - Standalone, extensible Perl module installer =head1 SYNOPSIS In your F: (Recommended Usage) use inc::Module::Install; # Define metadata name 'Your-Module'; all_from 'lib/Your/Module.pm'; # Specific dependencies requires 'File::Spec' => '0.80'; test_requires 'Test::More' => '0.42'; recommends 'Text::CSV_XS'=> '0.50'; no_index 'directory' => 'demos'; install_script 'myscript'; WriteAll; Quickly upgrade a legacy L installer: use inc::Module::Install; WriteMakefile( ... ); =head1 DESCRIPTION B is a package for writing installers for CPAN (or CPAN-like) distributions that are clean, simple, minimalist, act in a strictly correct manner with L, and will run on any Perl installation version 5.005 or newer. 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. =head2 Writing Module::Install Installers The quickest way to get started with Module::Install is to copy the L from above and save it as your own F. Then modify the file to suit your own particular case, using the list of commands documented in L below. 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. =head1 How it Works The motivation behind B is that distributions need to interact with a large number of different versions of L and module installers infrastructure, primarily L, L, L and L. These have accumulated B 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, For example, the L 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. Rather than try to target one specific installer and/or make you add twisty workaround expressions to every piece of install code you write, B will copy part of itself into each module distribution it creates. 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. =head2 History This module was originally written by Brian Ingerson as a smart drop-in replacement for L. For more information, see Brian's I in June 2003 issue of The Perl Journal (L). For a B more information, and some personal opinions on the module and its creation, see L. =head1 COMMON COMMANDS The following are the most common commands generally used in installers. It is far from an exhaustive list, as many of the plugins provide commands to work in more details that you would normally need. =head2 name name 'My-Module'; The B command is compulsory command, generally the first. It provides the name of your distribution, which for a module like B would normally be C. This naming scheme is not hard and fast and you should note that distributions are actually a separate naming scheme from modules. For example the L modules come in a distribution called C. =head2 all_from all_from 'lib/My/Module.pm'; 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 B command, which will try to extract as much metadata as possible from the Perl code and POD in that primary module. Functionally, C is equivalent to C + C + C + C + C. See below for details. If any of these values are set already B C is used, they will kept and B be overwritten. =head2 abstract abstract 'This distribution does something'; All distributions have an abstract, a short description of the distribution as a whole. It is usually around 30-70 characters long. The C command is used to explicitly set the abstract for the distribution, at least as far as the metadata file for the distribution is concerned. =head2 abstract_from abstract_from 'lib/My/Module.pm'; The C command retrieves the abstract from a particular file contained in the distribution package. Most often this is done from the main module, where C will read the POD and use whatever is in the C<=head1 NAME> section (with module name stripped if needed) C is set as part of C. =head2 author author 'Adam Kennedy '; 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. It you don't want to give away a real email address, you should use the C address you receive automatically when you got your PAUSE account. The C command is used to explicitly set this value. =head2 author_from author_from 'lib/My/Module.pm'; The C command retrieves the author from a particular file contained in the distribution package. Most often this is done using the main module, where L will read the POD and use whatever it can find in the C<=head1 AUTHOR> section. =head2 version version '0.01'; The C command is used to specify the version of the distribution, as distinct from the version of any single module within the distribution. 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 C. =head2 version_from version_from 'lib/My/Module.pm'; The C command retrieves the distribution version from a particular file contained in the distribution package. Most often this is done from the main module. C will look for the first time you set C<$VERSION> and use the same value, using a technique consistent with various other module version scanning tools. =head2 license license 'perl'; The C command specifies the license for the distribution. Most often this value will be C<'perl'>, meaning I<"the same as for Perl itself">. Other allowed values include C<'gpl'>, C<'lgpl'>, C<'bsd'>, C<'MIT'>, and C<'artistic'>. This value is always considered a summary, and it is normal for authors to include a F file in the distribution, containing the full license for the distribution. You are also reminded that if the distribution is intended to be uploaded to the CPAN, it B be an OSI-approved open source license. Commercial software is not permitted on the CPAN. =head2 license_from license_from 'lib/My/Module.pm'; The C command retrieves the distribution license from a particular file contained in the distribution package. Most often this is done from the main module. C 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. At this time it supports only the 6 values mentioned above in the C command summary. =head2 perl_version perl_version '5.006'; The C command is used to specify the minimum version of the perl interpreter your distribution requires. 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 C<'5.006'> and Perl 5.10.2 will become C<'5.010002'>. =head2 perl_version_from perl_version_from 'lib/My/Module.pm' The C command retrieves the minimum F interpreter version from a particular file contained in the distribution package. Most often this is done from the main module. The minimum version is detected by scanning the file for C pragma calls in the module file. =head2 recommends recommends 'Text::CSV_XS' => '0.50' The C 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". As with L, the dependency is on a B and not a distribution. A version of zero indicates that any version of the module is recommended. =head2 requires requires 'List::Util' => 0; requires 'LWP' => '5.69'; The C 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. A C dependency can be verbalised as I<"If you wish to install and use this distribution, you must first install these modules first">. Note that the dependency is on a B and not a distribution. This is to ensure that your dependency stays correct, even if the module is moved or merged into a different distribtion, as is occasionally the case. A dependency on version zero indicates B version of module is sufficient. Versions should generally be quoted for clarity. =head2 test_requires test_requires 'Test::More' => '0.47'; The C command indicates a test script dependency for the distribution. The specification format is identical to that of the C command. The C command is distinct from the C command in that it indicates a module that is needed B during the testing of the distribution (often a period of only a few seconds) but will B be needed after the distribution is installed. The C 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. The C command is sometimes used by some authors along with C 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. =head2 configure_requires configure_requires 'File::Spec' => '0.80'; The C command indicates a configure-time dependency for the distribution. The specification format is identical to that of the C command. The C 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. 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 C command. The C command creates an entry in the special configure_requires: key in the distribution's F file. Although most of F is considered advisory only, a L client will treat the contents of configure_requires: as authorative, and install the listed modules B it executes the F (from which it then determines the other dependencies). Please note that support for configure_requires: in CPAN clients is not 100% complete at time of writing, and still cannot be relied upon. Because B itself only supports 5.005, it will silently add the equivalent of a C<< configure_requires( perl => '5.005' ); >> command to your distribution. =head2 requires_external_bin requires_external_bin 'cvs'; As part of its role as the dominant "glue" language, a lot of Perl modules run commands or programs on the host system. The C command is used to verify that a particular command is available on the host system. Unlike a missing Perl module, a missing external binary is unresolvable at make-time, and so the F run will abort with a "NA" (Not Applicable) result. 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. =head2 install_script # The following are equivalent install_script 'script/scriptname' The C 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). Note that is it normal practice to B put a .pl on the end of such scripts, so that they feel more natural when being used. In the example above, the F