Commit | Line | Data |
3fea05b9 |
1 | package inc::Module::Install; |
2 | |
3 | # This module ONLY loads if the user has manually installed their own |
4 | # installation of Module::Install, and are some form of MI author. |
5 | # |
6 | # It runs from the installed location, and is never bundled |
7 | # along with the other bundled modules. |
8 | # |
9 | # So because the version of this differs from the version that will |
10 | # be bundled almost every time, it doesn't have it's own version and |
11 | # isn't part of the synchronisation-checking. |
12 | |
13 | use strict; |
14 | use vars qw{$VERSION}; |
15 | BEGIN { |
16 | # While this version will be overwritten when Module::Install |
17 | # loads, it remains so Module::Install itself can detect which |
18 | # version an author currently has installed. |
19 | # This allows it to implement any back-compatibility features |
20 | # it may want or need to. |
21 | $VERSION = '0.91'; |
22 | } |
23 | |
24 | if ( -d './inc' ) { |
25 | my $author = $^O eq 'VMS' ? './inc/_author' : './inc/.author'; |
26 | if ( -d $author ) { |
27 | $Module::Install::AUTHOR = 1; |
28 | require File::Path; |
29 | File::Path::rmtree('inc'); |
30 | } |
31 | } else { |
32 | $Module::Install::AUTHOR = 1; |
33 | } |
34 | |
35 | unshift @INC, 'inc' unless $INC[0] eq 'inc'; |
36 | require Module::Install; |
37 | |
38 | 1; |
39 | |
40 | __END__ |
41 | |
42 | =pod |
43 | |
44 | =head1 NAME |
45 | |
46 | inc::Module::Install - Module::Install configuration system |
47 | |
48 | =head1 SYNOPSIS |
49 | |
50 | use inc::Module::Install; |
51 | |
52 | =head1 DESCRIPTION |
53 | |
54 | This module first checks whether the F<inc/.author> directory exists, |
55 | and removes the whole F<inc/> directory if it does, so the module author |
56 | always get a fresh F<inc> every time they run F<Makefile.PL>. Next, it |
57 | unshifts C<inc> into C<@INC>, then loads B<Module::Install> from there. |
58 | |
59 | Below is an explanation of the reason for using a I<loader module>: |
60 | |
61 | The original implementation of B<CPAN::MakeMaker> introduces subtle |
62 | problems for distributions ending with C<CPAN> (e.g. B<CPAN.pm>, |
63 | B<WAIT::Format::CPAN>), because its placement in F<./CPAN/> duplicates |
64 | the real libraries that will get installed; also, the directory name |
65 | F<./CPAN/> may confuse users. |
66 | |
67 | On the other hand, putting included, for-build-time-only libraries in |
68 | F<./inc/> is a normal practice, and there is little chance that a |
69 | CPAN distribution will be called C<Something::inc>, so it's much safer |
70 | to use. |
71 | |
72 | Also, it allows for other helper modules like B<Module::AutoInstall> |
73 | to reside also in F<inc/>, and to make use of them. |
74 | |
75 | =head1 AUTHORS |
76 | |
77 | Audrey Tang E<lt>autrijus@autrijus.orgE<gt> |
78 | |
79 | =head1 COPYRIGHT |
80 | |
81 | Copyright 2003, 2004 Audrey Tang E<lt>autrijus@autrijus.orgE<gt>. |
82 | |
83 | This program is free software; you can redistribute it and/or modify it |
84 | under the same terms as Perl itself. |
85 | |
86 | See L<http://www.perl.com/perl/misc/Artistic.html> |
87 | |
88 | =cut |