ExtUtils-AutoInstall-0.64/000755 000765 000024 00000000000 12765576740 015615 5ustar00ingystaff000000 000000 ExtUtils-AutoInstall-0.64/AUTHORS000644 000765 000024 00000001313 10311277775 016652 0ustar00ingystaff000000 000000 Here is a list of people and their CPAN id, extracted from the Changes file and the mailing list archives. These people have either submitted patches or suggestions, or their bug reports or comments have inspired the appropriate patches. Corrections, additions, deletions welcome: Alan Burlison (ABURLISON) Bastian Blank (WALDI) Brian Ingerson (INGY) Bryan Dumm Chia-Liang Kao (CLKAO) David James (SPLICE) Eric Andreychek (ERIC) Jesse Vincent (JESSE) Jonathan Leffler (JOHNL) Jos I. Boumans (KANE) Matt Cashner (MCASHNER) Michael G Schwern (MSCHWERN) Rocco Caputo (RCAPUTO) Sam Tregar (SAMTREGAR) Shlomi Fish (SHLOMIF) Slaven Rezic (SREZIC) Sungo (SUNGO) ExtUtils-AutoInstall-0.64/Changes000644 000765 000024 00000000775 12765575301 017111 0ustar00ingystaff000000 000000 == Changes for 0.64 - September 12, 2016 * Applied patch: https://rt.cpan.org/Public/Bug/Display.html?id=113923#txn-1619691 == Changes for 0.63 - September 12, 2005 * Added some text in the POD's synopsis regarding --defaultdeps and the environment variable. == Changes for 0.62 - July 9, 2005 * With CPANPLUS, we no longer probe $Config{sitelib} for writability and suggest `sudo` for the entire installation process, as CPANPLUS can handle this with `sudo` on `make install`. Reported by Sungo. ExtUtils-AutoInstall-0.64/inc/000755 000765 000024 00000000000 12765576740 016366 5ustar00ingystaff000000 000000 ExtUtils-AutoInstall-0.64/lib/000755 000765 000024 00000000000 12765576740 016363 5ustar00ingystaff000000 000000 ExtUtils-AutoInstall-0.64/Makefile.PL000644 000765 000024 00000001433 10310275374 017547 0ustar00ingystaff000000 000000 #!/usr/bin/perl use inc::Module::Install; use lib 'lib'; name ('ExtUtils-AutoInstall'); abstract ('Automatic install of dependencies via CPAN'); author ('Autrijus Tang '); version_from ('lib/ExtUtils/AutoInstall.pm'); license ('perl'); requires ('Cwd'); requires ('Carp'); requires ('ExtUtils::Manifest'); requires ('ExtUtils::MakeMaker'); features ( 'CPANPLUS Support' => [ -default => 0, 'CPANPLUS' => '0.043', ], (eval { require version; version->VERSION >= 0.28 }) ? () : ( 'Nondecimal version number support' => [ -default => 0, 'Sort::Versions' => '1.2' ], ), ); auto_install(); &WriteAll( sign => 1 ); ExtUtils-AutoInstall-0.64/MANIFEST000644 000765 000024 00000000663 12765576265 016755 0ustar00ingystaff000000 000000 AUTHORS Changes inc/ExtUtils/AutoInstall.pm inc/Module/Install.pm inc/Module/Install/AutoInstall.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Include.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/ExtUtils/AutoInstall.pm Makefile.PL MANIFEST This list of files META.yml README t/1-basic.t TODO ExtUtils-AutoInstall-0.64/META.yml000644 000765 000024 00000000516 12765575500 017061 0ustar00ingystaff000000 000000 name: ExtUtils-AutoInstall version: 0.64 abstract: Automatic install of dependencies via CPAN author: Autrijus Tang license: perl distribution_type: module requires: Cwd: 0 Carp: 0 ExtUtils::Manifest: 0 ExtUtils::MakeMaker: 0 no_index: directory: - inc generated_by: Module::Install version 0.370 ExtUtils-AutoInstall-0.64/README000644 000765 000024 00000002326 12765575547 016504 0ustar00ingystaff000000 000000 This is the README file for ExtUtils::AutoInstall, a module to let Makefile.PL automatically install dependencies via CPAN or CPANPLUS. = Features * Letting the user enable/disable optional dependencies. * Support sane defaults by probing for the machine's capability. * If not inside a cpan shell, use CPAN.pm to install dependencies. * Enable/disable the associated tests automatically. * Supply UNINST=1 when it is safe and possibly needed. * Checks MANIFEST to avoid unnecessary grepping of EXE_FILES. * Utilizes CPANPLUS and/or Sort::Versions where feasible. * Offers check-only and skip-all Makefile.PL targets. * Offers check-only and install-only Makefile targets. * Take advantage of the 'sudo' command where available. = Installation ExtUtils::AutoInstall uses the standard perl module install process: cpansign -v # optional; see SIGNATURE for details perl Makefile.PL make # or 'nmake' on Win32 make test make install = Copyright Copyright 2001, 2002, 2003, 2004, 2005, 2016 by Autrijus Tang . All rights reserved. You can redistribute and/or modify this bundle under the same terms as Perl itself. See . ExtUtils-AutoInstall-0.64/t/000755 000765 000024 00000000000 12765576740 016060 5ustar00ingystaff000000 000000 ExtUtils-AutoInstall-0.64/TODO000644 000765 000024 00000000237 10310275374 016266 0ustar00ingystaff000000 000000 - Request for a specific version instead of the latest. - A cleaner self-boostrap block. - Default autoconf-like test utilities. - Module::Build integration. ExtUtils-AutoInstall-0.64/t/1-basic.t000644 000765 000024 00000012563 12765575774 017501 0ustar00ingystaff000000 000000 #!/usr/bin/perl use strict; use Test; BEGIN { plan tests => 6; $^W = 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 {} use Symbol (); my $fh = Symbol::gensym; my $out = tie *$fh, __PACKAGE__; select(*$fh); # test from a clean state $ENV{PERL_EXTUTILS_AUTOINSTALL} = ''; require ExtUtils::AutoInstall; ExtUtils::AutoInstall::_accept_default(0); *ExtUtils::AutoInstall::_prompt = sub { ok($_[1], shift(@prompts)); return 'n'; }; # calls the module. ok(eval <<'.', $@); use ExtUtils::AutoInstall ( -version => '0.21', # ExtUtils::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', }, ); ''; . # simulates a makefile. WriteMakefile( AUTHOR => 'Joe Hacker (joe@hacker.org)', ABSTRACT => 'Perl Interface to Joe Hacker', NAME => 'Joe::Hacker', VERSION_FROM => 'Hacker.pm', DISTNAME => 'Joe-Hacker', EXE_FILES => [ qw/foo bar baz/ ], ); # XXX - test currently disabled in anticipation of a # rewrite using Test::MockObject. exit; $$out =~ s/.*\n//; # strip the version-dependent line. ok($$out, qr/\Q*** Checking for dependencies... [Core Features] - Package0 ...failed! (needed) [Feature1] - Package1 ...failed! (needs 0.01) [Feature2] - Package2 ...failed! (needs 0.02) [Feature3] - Package3 ...failed! (needs 0.03)\E .*\Q *** ExtUtils::AutoInstall configuration finished.\E/s); use vars qw/@Data_Stack $DNE/; $mm_args->{test}{TESTS} = ''; # XXX: workaround false-positive globbing ok(_deep_check($mm_args, { ABSTRACT => 'Perl Interface to Joe Hacker', test => { 'TESTS' => '' }, NAME => 'Joe::Hacker', DISTNAME => 'Joe-Hacker', AUTHOR => 'Joe Hacker (joe@hacker.org)', EXE_FILES => [], VERSION_FROM => 'Hacker.pm', })); ####################################################################### # The following section is adapated verbatim from Test::More v0.32. # # According to the Artistic License, the copyright information of # Test::More is acknowledged here: # # Test::More - yet another framework for writing test scripts # # AUTHOR # # Michael G Schwern with much inspiration from # Joshua Pritikin's Test module and lots of discussion with Barrie # Slaymaker and the perl-qa gang. # # The source code of Test::More may be acquired at http://www.cpan.org/, # or from a standard perl distribution of v5.7.2+. # ####################################################################### sub _deep_check { my($e1, $e2) = @_; my $ok = 0; my $eq; { # Quiet unintialized value warnings when comparing undefs. local $^W = 0; if( $e1 eq $e2 ) { $ok = 1; } else { if( UNIVERSAL::isa($e1, 'ARRAY') and UNIVERSAL::isa($e2, 'ARRAY') ) { $ok = eq_array($e1, $e2); } elsif( UNIVERSAL::isa($e1, 'HASH') and UNIVERSAL::isa($e2, 'HASH') ) { $ok = eq_hash($e1, $e2); } elsif( UNIVERSAL::isa($e1, 'REF') and UNIVERSAL::isa($e2, 'REF') ) { push @Data_Stack, { type => 'REF', vals => [$e1, $e2] }; $ok = _deep_check($$e1, $$e2); pop @Data_Stack if $ok; } elsif( UNIVERSAL::isa($e1, 'SCALAR') and UNIVERSAL::isa($e2, 'SCALAR') ) { push @Data_Stack, { type => 'REF', vals => [$e1, $e2] }; $ok = _deep_check($$e1, $$e2); } else { push @Data_Stack, { vals => [$e1, $e2] }; $ok = 0; } } } return $ok; } sub eq_hash { my($a1, $a2) = @_; return 1 if $a1 eq $a2; my $ok = 1; my $bigger = keys %$a1 > keys %$a2 ? $a1 : $a2; foreach my $k (keys %$bigger) { my $e1 = exists $a1->{$k} ? $a1->{$k} : $DNE; my $e2 = exists $a2->{$k} ? $a2->{$k} : $DNE; push @Data_Stack, { type => 'HASH', idx => $k, vals => [$e1, $e2] }; $ok = _deep_check($e1, $e2); pop @Data_Stack if $ok; last unless $ok; } return $ok; } sub eq_array { my($a1, $a2) = @_; return 1 if $a1 eq $a2; my $ok = 1; my $max = $#$a1 > $#$a2 ? $#$a1 : $#$a2; for (0..$max) { my $e1 = $_ > $#$a1 ? $DNE : $a1->[$_]; my $e2 = $_ > $#$a2 ? $DNE : $a2->[$_]; push @Data_Stack, { type => 'ARRAY', idx => $_, vals => [$e1, $e2] }; $ok = _deep_check($e1,$e2); pop @Data_Stack if $ok; last unless $ok; } return $ok; } ExtUtils-AutoInstall-0.64/lib/ExtUtils/000755 000765 000024 00000000000 12765576740 020144 5ustar00ingystaff000000 000000 ExtUtils-AutoInstall-0.64/lib/ExtUtils/AutoInstall.pm000644 000765 000024 00000075210 12765575657 022754 0ustar00ingystaff000000 000000 package ExtUtils::AutoInstall; $ExtUtils::AutoInstall::VERSION = '0.64'; use strict; use Cwd (); use ExtUtils::MakeMaker (); =head1 NAME ExtUtils::AutoInstall - Automatic install of dependencies via CPAN =head1 VERSION This document describes version 0.63 of B, released September 12, 2005. =head1 SYNOPSIS In F, with L available on the author's system: use inc::Module::Install; name ('Joe-Hacker'); abstract ('Perl Interface to Joe Hacker'); author ('Joe Hacker '); include ('ExtUtils::AutoInstall'); requires ('Module0'); # mandatory modules features ( -config => { make_args => '--hello', # option(s) for CPAN::Config force => 1, # pseudo-option to force install do_once => 1, # skip previously failed modules }, 'Feature1' => [ 'Module2' => '0.1', ], 'Feature2' => [ 'Module3' => '1.0', ], ); auto_install(); &WriteAll; Invoking the resulting F: % perl Makefile.PL # interactive behaviour % perl Makefile.PL --defaultdeps # accept default value on prompts % perl Makefile.PL --checkdeps # check only, no Makefile produced % perl Makefile.PL --skipdeps # ignores all dependencies % perl Makefile.PL --testonly # don't write installation targets Note that the trailing 'deps' of arguments may be omitted, too. Using C<--defaultdeps> will make F behave similarly to a regular Makefile.PL file with C dependencies. One can use environment variables (see "ENVIRONMENT") below to set a default behavior instead of specifying it in the command line for every invocation of F. Using F (or F): % make [all|test|install] # install dependencies first % make checkdeps # same as the --checkdeps above % make installdeps # install dependencies only =head1 DESCRIPTION B lets module writers to specify a more sophisticated form of dependency information than the C option offered by B. This module works best with the B framework, a drop-in replacement for MakeMaker. However, this module also supports F files based on MakeMaker; see L for instructions. =head2 Prerequisites and Features Prerequisites are grouped into B, and the user could choose yes/no on each one's dependencies; the module writer may also supply a boolean value via C<-default> to specify the default choice. The B marked by the name C<-core> will double-check with the user, if the user chooses not to install the mandatory modules. This differs from the pre-0.26 'silent install' behaviour. Starting from version 0.27, if C<-core> is set to the string C (case-insensitive), every feature will be considered mandatory. The dependencies are expressed as pairs of C => C inside an array reference. If the order does not matter, and there are no C<-default>, C<-tests> or C<-skiptests> directives for that feature, you may also use a hash reference. =head2 The Installation Process Once B has determined which module(s) are needed, it checks whether it's running under the B shell and should therefore let B handle the dependency. Finally, the C is overridden to perform some additional checks, as well as skips tests associated with disabled features by the C<-tests> option. The actual installation happens at the end of the C target; both C and C will trigger the installation of required modules. If it's not running under B, the installer will probe for an active connection by trying to resolve the domain C, and check for the user's permission to use B. If all went well, a separate B instance is created to install the required modules. If you have the B package installed in your system, it is preferred by default over B; it also accepts some extra options (e.g. C<-target =E 'skiptest', -skiptest =E 1> to skip testing). All modules scheduled to be installed will be deleted from C<%INC> first, so B will check the newly installed modules. Additionally, you could use the C target to install the modules, and the C target to check dependencies without actually installing them; the C command has an equivalent effect. If the F itself needs to use an independent module (e.g. B, v1.21 or greater), then use something like below: BEGIN { require ExtUtils::AutoInstall; # the first argument is an arrayref of the -config flags ExtUtils::AutoInstall->install([], 'Acme::KillerApp' => 1.21); } use Acme::KillerApp 1.21; ExtUtils::AutoInstall->import( # ... arguments as usual ... ); Note the version test in the use clause; if you are so close to the cutting edge that B 1.20 is the latest version on CPAN, this will prevent your module from going awry. =head2 User-Defined Hooks User-defined I and I hooks are available via C and C subroutines, as shown below: # pre-install handler; takes $module_name and $version sub MY::preinstall { return 1; } # return false to skip install # post-install handler; takes $module_name, $version, $success sub MY::postinstall { return; } # the return value doesn't matter Note that since B performs installation at the time of C (i.e. before perl parses the remainder of F), you have to declare those two handlers I the C statement for them to take effect. If the user did not choose to install a module or it already exists on the system, neither of the handlers is invoked. Both handlers are invoked exactly once for each module when installation is attempted. C takes two arguments, C<$module_name> and C<$version>; if it returns a false value, installation for that module will be skipped, and C won't be called at all. C takes three arguments, C<$module_name>, C<$version> and C<$success>. The last one denotes whether the installation succeeded or not: C<1> means installation completed successfully, C<0> means failure during install, and C means that the installation was not attempted at all, possibly due to connection problems, or that module does not exist on CPAN at all. =head2 Customized C Starting from version 0.43, B supports modules that require a C subroutine in their F. The user-defined C, if present, is responsible for calling C and include the output in its return value. For example, the B (database driver) modules for the Perl DBI are required to include the postamble generated by the function C, so their F may contain lines like this: sub MY::postamble { return &ExtUtils::AutoInstall::postamble . &dbd_postamble; } Note that the B module does not export the C function, so the name should always be fully qualified. =head1 CAVEATS B will add C to your B flags if your effective uid is 0 (root), unless you explicitly disable it by setting B's C configuration option (or the C option of B) to include C. This I cause dependency problems if you are using a fine-tuned directory structure for your site. Please consult L for an explanation in detail. If either B or B is available, they will be used to compare the required version with the existing module's version and the CPAN module's. Otherwise it silently falls back to use I. This may cause inconsistent behaviours in pathetic situations. =head1 NOTES Since this module is needed before writing F, it makes little use as a CPAN module; hence each distribution must include it in full. The only alternative I'm aware of, namely prompting in F to force user install it (cf. the B