line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Starter::Simple; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
69617
|
use 5.006; |
|
3
|
|
|
|
|
29
|
|
4
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
76
|
|
5
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
95
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
16
|
use Cwd 'cwd'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
166
|
|
8
|
3
|
|
|
3
|
|
1485
|
use ExtUtils::Command qw( rm_rf mkpath touch ); |
|
3
|
|
|
|
|
5608
|
|
|
3
|
|
|
|
|
192
|
|
9
|
3
|
|
|
3
|
|
21
|
use File::Spec (); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
59
|
|
10
|
3
|
|
|
3
|
|
19
|
use Carp qw( carp confess croak ); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
172
|
|
11
|
3
|
|
|
3
|
|
490
|
use Module::Runtime qw( require_module ); |
|
3
|
|
|
|
|
1859
|
|
|
3
|
|
|
|
|
19
|
|
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
1388
|
use Module::Starter::BuilderSet; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
16857
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Module::Starter::Simple - a simple, comprehensive Module::Starter plugin |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 VERSION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Version 1.76 |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our $VERSION = '1.76'; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
use Module::Starter qw(Module::Starter::Simple); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Module::Starter->create_distro(%args); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Module::Starter::Simple is a plugin for Module::Starter that will perform all |
36
|
|
|
|
|
|
|
the work needed to create a distribution. Given the parameters detailed in |
37
|
|
|
|
|
|
|
L, it will create content, create directories, and populate |
38
|
|
|
|
|
|
|
the directories with the required files. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 CLASS METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 C<< new(%args) >> |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This method is called to construct and initialize a new Module::Starter object. |
45
|
|
|
|
|
|
|
It is never called by the end user, only internally by C, which |
46
|
|
|
|
|
|
|
creates ephemeral Module::Starter objects. It's documented only to call it to |
47
|
|
|
|
|
|
|
the attention of subclass authors. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub new { |
52
|
58
|
|
|
58
|
1
|
134
|
my $class = shift; |
53
|
58
|
|
|
|
|
498
|
return bless { @_ } => $class; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 OBJECT METHODS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
All the methods documented below are object methods, meant to be called |
59
|
|
|
|
|
|
|
internally by the ephemeral objects created during the execution of the class |
60
|
|
|
|
|
|
|
method C above. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 postprocess_config |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
A hook to do any work after the configuration is initially processed. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
0
|
1
|
0
|
sub postprocess_config { 1 }; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 pre_create_distro |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
A hook to do any work right before the distro is created. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
0
|
1
|
0
|
sub pre_create_distro { 1 }; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 C<< create_distro(%args) >> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This method works as advertised in L. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub create_distro { |
85
|
58
|
|
|
58
|
1
|
31025560
|
my $either = shift; |
86
|
|
|
|
|
|
|
|
87
|
58
|
50
|
|
|
|
506
|
( ref $either ) or $either = $either->new( @_ ); |
88
|
|
|
|
|
|
|
|
89
|
58
|
|
|
|
|
179
|
my $self = $either; |
90
|
58
|
|
50
|
|
|
248
|
my $modules = $self->{modules} || []; |
91
|
58
|
|
|
|
|
141
|
my @modules = map { split /,/ } @{$modules}; |
|
600
|
|
|
|
|
1406
|
|
|
58
|
|
|
|
|
147
|
|
92
|
58
|
50
|
|
|
|
305
|
croak "No modules specified.\n" unless @modules; |
93
|
58
|
|
|
|
|
172
|
for (@modules) { |
94
|
600
|
50
|
|
|
|
2336
|
croak "Invalid module name: $_" unless /\A[a-z_]\w*(?:::[\w]+)*\Z/i; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
58
|
50
|
33
|
|
|
353
|
if ( ( not $self->{author} ) && ( $^O ne 'MSWin32' ) ) { |
98
|
0
|
|
|
|
|
0
|
( $self->{author} ) = split /,/, ( getpwuid $> )[6]; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
58
|
0
|
33
|
|
|
206
|
if ( not $self->{email} and exists $ENV{EMAIL} ) { |
102
|
0
|
|
|
|
|
0
|
$self->{email} = $ENV{EMAIL}; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
58
|
50
|
|
|
|
167
|
croak "Must specify an author\n" unless $self->{author}; |
106
|
58
|
50
|
|
|
|
225
|
croak "Must specify an email address\n" unless $self->{email}; |
107
|
58
|
|
|
|
|
376
|
($self->{email_obfuscated} = $self->{email}) =~ s/@/ at /; |
108
|
|
|
|
|
|
|
|
109
|
58
|
|
50
|
|
|
188
|
$self->{license} ||= 'artistic2'; |
110
|
58
|
|
100
|
|
|
201
|
$self->{minperl} ||= '5.006'; |
111
|
58
|
|
100
|
|
|
189
|
$self->{ignores_type} ||= ['generic']; |
112
|
58
|
|
|
|
|
137
|
$self->{manifest_skip} = !! grep { /manifest/ } @{ $self->{ignores_type} }; |
|
226
|
|
|
|
|
643
|
|
|
58
|
|
|
|
|
191
|
|
113
|
|
|
|
|
|
|
|
114
|
58
|
|
|
|
|
273
|
$self->{license_record} = $self->_license_record(); |
115
|
|
|
|
|
|
|
|
116
|
58
|
|
|
|
|
711
|
$self->{main_module} = $modules[0]; |
117
|
58
|
50
|
33
|
|
|
421
|
if ( not defined $self->{distro} or not length $self->{distro} ) { |
118
|
0
|
|
|
|
|
0
|
$self->{distro} = $self->{main_module}; |
119
|
0
|
|
|
|
|
0
|
$self->{distro} =~ s/::/-/g; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
58
|
|
33
|
|
|
296
|
$self->{basedir} = $self->{dir} || $self->{distro}; |
123
|
58
|
|
|
|
|
292
|
$self->create_basedir; |
124
|
|
|
|
|
|
|
|
125
|
58
|
|
|
|
|
136
|
my @files; |
126
|
58
|
|
|
|
|
357
|
push @files, $self->create_modules( @modules ); |
127
|
|
|
|
|
|
|
|
128
|
58
|
|
|
|
|
314
|
push @files, $self->create_t( @modules ); |
129
|
58
|
|
|
|
|
293
|
push @files, $self->create_ignores; |
130
|
58
|
|
|
|
|
253
|
my %build_results = $self->create_build(); |
131
|
58
|
|
|
|
|
164
|
push(@files, @{ $build_results{files} } ); |
|
58
|
|
|
|
|
170
|
|
132
|
|
|
|
|
|
|
|
133
|
58
|
|
|
|
|
256
|
push @files, $self->create_Changes; |
134
|
58
|
|
|
|
|
249
|
push @files, $self->create_README( $build_results{instructions} ); |
135
|
58
|
50
|
|
|
|
313
|
push @files, $self->create_LICENSE if $self->{genlicense}; |
136
|
|
|
|
|
|
|
|
137
|
58
|
100
|
|
|
|
312
|
$self->create_MANIFEST( $build_results{'manifest_method'} ) unless ( $self->{manifest_skip} ); |
138
|
|
|
|
|
|
|
# TODO: put files to ignore in a more standard form? |
139
|
|
|
|
|
|
|
# XXX: no need to return the files created |
140
|
|
|
|
|
|
|
|
141
|
58
|
|
|
|
|
1371
|
return; |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head2 post_create_distro |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
A hook to do any work after creating the distribution. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=cut |
149
|
|
|
|
|
|
|
|
150
|
0
|
|
|
0
|
1
|
0
|
sub post_create_distro { 1 }; |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head2 pre_exit |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
A hook to do any work right before exit time. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=cut |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub pre_exit { |
159
|
0
|
|
|
0
|
1
|
0
|
print "Created starter directories and files\n"; |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head2 create_basedir |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
Creates the base directory for the distribution. If the directory already |
165
|
|
|
|
|
|
|
exists, and I<$force> is true, then the existing directory will get erased. |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
If the directory can't be created, or re-created, it dies. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=cut |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
sub create_basedir { |
172
|
58
|
|
|
58
|
1
|
149
|
my $self = shift; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# Make sure there's no directory |
175
|
58
|
100
|
|
|
|
1896
|
if ( -e $self->{basedir} ) { |
176
|
|
|
|
|
|
|
die( "$self->{basedir} already exists. ". |
177
|
|
|
|
|
|
|
"Use --force if you want to stomp on it.\n" |
178
|
28
|
50
|
|
|
|
183
|
) unless $self->{force}; |
179
|
|
|
|
|
|
|
|
180
|
28
|
|
|
|
|
178
|
local @ARGV = $self->{basedir}; |
181
|
28
|
|
|
|
|
225
|
rm_rf(); |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
die "Couldn't delete existing $self->{basedir}: $!\n" |
184
|
28
|
50
|
|
|
|
201173
|
if -e $self->{basedir}; |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
CREATE_IT: { |
188
|
58
|
|
|
|
|
198
|
$self->progress( "Created $self->{basedir}" ); |
|
58
|
|
|
|
|
563
|
|
189
|
|
|
|
|
|
|
|
190
|
58
|
|
|
|
|
299
|
local @ARGV = $self->{basedir}; |
191
|
58
|
|
|
|
|
343
|
mkpath(); |
192
|
|
|
|
|
|
|
|
193
|
58
|
50
|
|
|
|
12990
|
die "Couldn't create $self->{basedir}: $!\n" unless -d $self->{basedir}; |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
58
|
|
|
|
|
185
|
return; |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head2 create_modules( @modules ) |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
This method will create a starter module file for each module named in |
202
|
|
|
|
|
|
|
I<@modules>. |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=cut |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
sub create_modules { |
207
|
58
|
|
|
58
|
1
|
145
|
my $self = shift; |
208
|
58
|
|
|
|
|
280
|
my @modules = @_; |
209
|
|
|
|
|
|
|
|
210
|
58
|
|
|
|
|
99
|
my @files; |
211
|
|
|
|
|
|
|
|
212
|
58
|
|
|
|
|
214
|
for my $module ( @modules ) { |
213
|
600
|
|
|
|
|
1469
|
my $rtname = lc $module; |
214
|
600
|
|
|
|
|
3008
|
$rtname =~ s/::/-/g; |
215
|
600
|
|
|
|
|
1779
|
push @files, $self->_create_module( $module, $rtname ); |
216
|
|
|
|
|
|
|
} |
217
|
|
|
|
|
|
|
|
218
|
58
|
|
|
|
|
455
|
return @files; |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
=head2 module_guts( $module, $rtname ) |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
This method returns the text which should serve as the contents for the named |
224
|
|
|
|
|
|
|
module. I<$rtname> is the email suffix which rt.cpan.org will use for bug |
225
|
|
|
|
|
|
|
reports. (This should, and will, be moved out of the parameters for this |
226
|
|
|
|
|
|
|
method eventually.) |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=cut |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
our $LICENSES = { |
231
|
|
|
|
|
|
|
perl => 'Perl_5', |
232
|
|
|
|
|
|
|
artistic => 'Artistic_1_0', |
233
|
|
|
|
|
|
|
artistic2 => 'Artistic_2_0', |
234
|
|
|
|
|
|
|
mozilla => 'Mozilla_1_1', |
235
|
|
|
|
|
|
|
mozilla2 => 'Mozilla_2_0', |
236
|
|
|
|
|
|
|
bsd => 'BSD', |
237
|
|
|
|
|
|
|
freebsd => 'FreeBSD', |
238
|
|
|
|
|
|
|
cc0 => 'CC0_1_0', |
239
|
|
|
|
|
|
|
gpl => 'GPL_2', |
240
|
|
|
|
|
|
|
lgpl => 'LGPL_2_1', |
241
|
|
|
|
|
|
|
gpl3 => 'GPL_3', |
242
|
|
|
|
|
|
|
lgpl3 => 'LGPL_3_0', |
243
|
|
|
|
|
|
|
agpl3 => 'AGPL_3', |
244
|
|
|
|
|
|
|
apache => 'Apache_2_0', |
245
|
|
|
|
|
|
|
qpl => 'QPL_1_0', |
246
|
|
|
|
|
|
|
}; |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
sub _license_record { |
249
|
58
|
|
|
58
|
|
140
|
my $self = shift; |
250
|
58
|
|
|
|
|
263
|
my $key = $LICENSES->{ $self->{license} }; |
251
|
58
|
50
|
|
|
|
176
|
$key = $self->{license} unless defined $key; |
252
|
58
|
50
|
|
|
|
328
|
my $class = $key =~ m/::/ ? $key : "Software::License::$key"; |
253
|
|
|
|
|
|
|
{ |
254
|
58
|
|
|
|
|
145
|
local $@; |
|
58
|
|
|
|
|
137
|
|
255
|
58
|
50
|
33
|
|
|
125
|
undef $class unless eval { require_module $class; 1 } and $class->can('new'); |
|
58
|
|
|
|
|
300
|
|
|
58
|
|
|
|
|
49920
|
|
256
|
|
|
|
|
|
|
} |
257
|
58
|
50
|
|
|
|
236
|
unless (defined $class) { |
258
|
0
|
|
|
|
|
0
|
require Software::LicenseUtils; |
259
|
0
|
|
|
|
|
0
|
($class) = Software::LicenseUtils->guess_license_from_meta_key($key); |
260
|
0
|
0
|
|
|
|
0
|
return undef unless defined $class; |
261
|
|
|
|
|
|
|
} |
262
|
58
|
|
|
|
|
428
|
return $class->new( { holder => $self->{author} } ); |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
sub _license_blurb { |
266
|
658
|
|
|
658
|
|
911
|
my $self = shift; |
267
|
|
|
|
|
|
|
|
268
|
658
|
|
|
|
|
1106
|
my $record = $self->{license_record}; |
269
|
658
|
50
|
|
|
|
2625
|
my $license_blurb = defined($record) ? |
270
|
|
|
|
|
|
|
$record->notice : |
271
|
|
|
|
|
|
|
<<"EOT"; |
272
|
0
|
|
|
|
|
0
|
This software is Copyright (c) @{[ $self->_thisyear ]} by $self->{author}. |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
This program is released under the following license: |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
$self->{license} |
277
|
|
|
|
|
|
|
EOT |
278
|
|
|
|
|
|
|
|
279
|
658
|
|
|
|
|
843374
|
chomp $license_blurb; |
280
|
658
|
|
|
|
|
1740
|
return $license_blurb; |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
# _create_module: used by create_modules to build each file and put data in it |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
sub _create_module { |
286
|
600
|
|
|
600
|
|
1025
|
my $self = shift; |
287
|
600
|
|
|
|
|
866
|
my $module = shift; |
288
|
600
|
|
|
|
|
865
|
my $rtname = shift; |
289
|
|
|
|
|
|
|
|
290
|
600
|
|
|
|
|
2036
|
my @parts = split( /::/, $module ); |
291
|
600
|
|
|
|
|
1376
|
my $filepart = (pop @parts) . '.pm'; |
292
|
600
|
|
|
|
|
1823
|
my @dirparts = ( $self->{basedir}, 'lib', @parts ); |
293
|
600
|
|
|
|
|
1081
|
my $SLASH = q{/}; |
294
|
600
|
|
|
|
|
1863
|
my $manifest_file = join( $SLASH, 'lib', @parts, $filepart ); |
295
|
600
|
50
|
|
|
|
1525
|
if ( @dirparts ) { |
296
|
600
|
|
|
|
|
6108
|
my $dir = File::Spec->catdir( @dirparts ); |
297
|
600
|
100
|
|
|
|
12964
|
if ( not -d $dir ) { |
298
|
479
|
|
|
|
|
2344
|
local @ARGV = $dir; |
299
|
479
|
|
|
|
|
2031
|
mkpath @ARGV; |
300
|
479
|
|
|
|
|
127261
|
$self->progress( "Created $dir" ); |
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
600
|
|
|
|
|
6729
|
my $module_file = File::Spec->catfile( @dirparts, $filepart ); |
305
|
|
|
|
|
|
|
|
306
|
600
|
|
|
|
|
4988
|
$self->{module_file}{$module} = File::Spec->catfile('lib', @parts, $filepart); |
307
|
600
|
|
|
|
|
2216
|
$self->create_file( $module_file, $self->module_guts( $module, $rtname ) ); |
308
|
600
|
|
|
|
|
3817
|
$self->progress( "Created $module_file" ); |
309
|
|
|
|
|
|
|
|
310
|
600
|
|
|
|
|
2791
|
return $manifest_file; |
311
|
|
|
|
|
|
|
} |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
sub _thisyear { |
314
|
0
|
|
|
0
|
|
0
|
return (localtime())[5] + 1900; |
315
|
|
|
|
|
|
|
} |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
sub _module_to_pm_file { |
318
|
658
|
|
|
658
|
|
1032
|
my $self = shift; |
319
|
658
|
|
|
|
|
1002
|
my $module = shift; |
320
|
|
|
|
|
|
|
|
321
|
658
|
|
|
|
|
1649
|
my @parts = split( /::/, $module ); |
322
|
658
|
|
|
|
|
1114
|
my $pm = pop @parts; |
323
|
658
|
|
|
|
|
4193
|
my $pm_file = File::Spec->catfile( 'lib', @parts, "${pm}.pm" ); |
324
|
658
|
|
|
|
|
1620
|
$pm_file =~ s{\\}{/}g; # even on Win32, use forward slash |
325
|
|
|
|
|
|
|
|
326
|
658
|
|
|
|
|
2213
|
return $pm_file; |
327
|
|
|
|
|
|
|
} |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
sub _reference_links { |
330
|
|
|
|
|
|
|
return ( |
331
|
658
|
|
|
658
|
|
4821
|
{ nickname => 'RT', |
332
|
|
|
|
|
|
|
title => 'CPAN\'s request tracker (report bugs here)', |
333
|
|
|
|
|
|
|
link => 'https://rt.cpan.org/NoAuth/Bugs.html?Dist=%s', |
334
|
|
|
|
|
|
|
}, |
335
|
|
|
|
|
|
|
{ nickname => 'AnnoCPAN', |
336
|
|
|
|
|
|
|
title => 'Annotated CPAN documentation', |
337
|
|
|
|
|
|
|
link => 'http://annocpan.org/dist/%s', |
338
|
|
|
|
|
|
|
}, |
339
|
|
|
|
|
|
|
{ title => 'CPAN Ratings', |
340
|
|
|
|
|
|
|
link => 'https://cpanratings.perl.org/d/%s', |
341
|
|
|
|
|
|
|
}, |
342
|
|
|
|
|
|
|
{ title => 'Search CPAN', |
343
|
|
|
|
|
|
|
link => 'https://metacpan.org/release/%s', |
344
|
|
|
|
|
|
|
}, |
345
|
|
|
|
|
|
|
); |
346
|
|
|
|
|
|
|
} |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
=head2 create_Makefile_PL( $main_module ) |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
This will create the Makefile.PL for the distribution, and will use the module |
351
|
|
|
|
|
|
|
named in I<$main_module> as the main module of the distribution. |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
=cut |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
sub create_Makefile_PL { |
356
|
34
|
|
|
34
|
1
|
74
|
my $self = shift; |
357
|
34
|
|
|
|
|
65
|
my $main_module = shift; |
358
|
34
|
|
|
|
|
156
|
my $builder_name = 'ExtUtils::MakeMaker'; |
359
|
34
|
|
|
|
|
98
|
my $output_file = |
360
|
|
|
|
|
|
|
Module::Starter::BuilderSet->new()->file_for_builder($builder_name); |
361
|
34
|
|
|
|
|
526
|
my $fname = File::Spec->catfile( $self->{basedir}, $output_file ); |
362
|
|
|
|
|
|
|
|
363
|
34
|
|
|
|
|
170
|
$self->create_file( |
364
|
|
|
|
|
|
|
$fname, |
365
|
|
|
|
|
|
|
$self->Makefile_PL_guts( |
366
|
|
|
|
|
|
|
$main_module, |
367
|
|
|
|
|
|
|
$self->_module_to_pm_file($main_module), |
368
|
|
|
|
|
|
|
), |
369
|
|
|
|
|
|
|
); |
370
|
|
|
|
|
|
|
|
371
|
34
|
|
|
|
|
265
|
$self->progress( "Created $fname" ); |
372
|
|
|
|
|
|
|
|
373
|
34
|
|
|
|
|
87
|
return $output_file; |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
=head2 create_MI_Makefile_PL( $main_module ) |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
This will create a Module::Install Makefile.PL for the distribution, and will |
379
|
|
|
|
|
|
|
use the module named in I<$main_module> as the main module of the distribution. |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
=cut |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
sub create_MI_Makefile_PL { |
384
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
385
|
0
|
|
|
|
|
0
|
my $main_module = shift; |
386
|
0
|
|
|
|
|
0
|
my $builder_name = 'Module::Install'; |
387
|
0
|
|
|
|
|
0
|
my $output_file = |
388
|
|
|
|
|
|
|
Module::Starter::BuilderSet->new()->file_for_builder($builder_name); |
389
|
0
|
|
|
|
|
0
|
my $fname = File::Spec->catfile( $self->{basedir}, $output_file ); |
390
|
|
|
|
|
|
|
|
391
|
0
|
|
|
|
|
0
|
$self->create_file( |
392
|
|
|
|
|
|
|
$fname, |
393
|
|
|
|
|
|
|
$self->MI_Makefile_PL_guts( |
394
|
|
|
|
|
|
|
$main_module, |
395
|
|
|
|
|
|
|
$self->_module_to_pm_file($main_module), |
396
|
|
|
|
|
|
|
), |
397
|
|
|
|
|
|
|
); |
398
|
|
|
|
|
|
|
|
399
|
0
|
|
|
|
|
0
|
$self->progress( "Created $fname" ); |
400
|
|
|
|
|
|
|
|
401
|
0
|
|
|
|
|
0
|
return $output_file; |
402
|
|
|
|
|
|
|
} |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
=head2 Makefile_PL_guts( $main_module, $main_pm_file ) |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
This method is called by create_Makefile_PL and returns text used to populate |
407
|
|
|
|
|
|
|
Makefile.PL; I<$main_pm_file> is the filename of the distribution's main |
408
|
|
|
|
|
|
|
module, I<$main_module>. |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
=cut |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
sub Makefile_PL_guts { |
413
|
34
|
|
|
34
|
1
|
205
|
my $self = shift; |
414
|
34
|
|
|
|
|
66
|
my $main_module = shift; |
415
|
34
|
|
|
|
|
67
|
my $main_pm_file = shift; |
416
|
|
|
|
|
|
|
|
417
|
34
|
|
|
|
|
164
|
(my $author = "$self->{author} <$self->{email}>") =~ s/'/\'/g; |
418
|
|
|
|
|
|
|
|
419
|
34
|
50
|
|
|
|
206
|
my $slname = $self->{license_record} ? $self->{license_record}->meta2_name : $self->{license}; |
420
|
|
|
|
|
|
|
|
421
|
34
|
50
|
|
|
|
338
|
my $warnings = sprintf 'warnings%s;', ($self->{fatalize} ? " FATAL => 'all'" : ''); |
422
|
|
|
|
|
|
|
|
423
|
34
|
|
|
|
|
565
|
return <<"HERE"; |
424
|
|
|
|
|
|
|
use $self->{minperl}; |
425
|
|
|
|
|
|
|
use strict; |
426
|
|
|
|
|
|
|
use $warnings |
427
|
|
|
|
|
|
|
use ExtUtils::MakeMaker; |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
my %WriteMakefileArgs = ( |
430
|
|
|
|
|
|
|
NAME => '$main_module', |
431
|
|
|
|
|
|
|
AUTHOR => q{$author}, |
432
|
|
|
|
|
|
|
VERSION_FROM => '$main_pm_file', |
433
|
|
|
|
|
|
|
ABSTRACT_FROM => '$main_pm_file', |
434
|
|
|
|
|
|
|
LICENSE => '$slname', |
435
|
|
|
|
|
|
|
MIN_PERL_VERSION => '$self->{minperl}', |
436
|
|
|
|
|
|
|
CONFIGURE_REQUIRES => { |
437
|
|
|
|
|
|
|
'ExtUtils::MakeMaker' => '0', |
438
|
|
|
|
|
|
|
}, |
439
|
|
|
|
|
|
|
TEST_REQUIRES => { |
440
|
|
|
|
|
|
|
'Test::More' => '0', |
441
|
|
|
|
|
|
|
}, |
442
|
|
|
|
|
|
|
PREREQ_PM => { |
443
|
|
|
|
|
|
|
#'ABC' => '1.6', |
444
|
|
|
|
|
|
|
#'Foo::Bar::Module' => '5.0401', |
445
|
|
|
|
|
|
|
}, |
446
|
|
|
|
|
|
|
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, |
447
|
|
|
|
|
|
|
clean => { FILES => '$self->{distro}-*' }, |
448
|
|
|
|
|
|
|
); |
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
# Compatibility with old versions of ExtUtils::MakeMaker |
451
|
|
|
|
|
|
|
unless (eval { ExtUtils::MakeMaker->VERSION('6.64'); 1 }) { |
452
|
|
|
|
|
|
|
my \$test_requires = delete \$WriteMakefileArgs{TEST_REQUIRES} || {}; |
453
|
|
|
|
|
|
|
\@{\$WriteMakefileArgs{PREREQ_PM}}{keys %\$test_requires} = values %\$test_requires; |
454
|
|
|
|
|
|
|
} |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
unless (eval { ExtUtils::MakeMaker->VERSION('6.55_03'); 1 }) { |
457
|
|
|
|
|
|
|
my \$build_requires = delete \$WriteMakefileArgs{BUILD_REQUIRES} || {}; |
458
|
|
|
|
|
|
|
\@{\$WriteMakefileArgs{PREREQ_PM}}{keys %\$build_requires} = values %\$build_requires; |
459
|
|
|
|
|
|
|
} |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
delete \$WriteMakefileArgs{CONFIGURE_REQUIRES} |
462
|
|
|
|
|
|
|
unless eval { ExtUtils::MakeMaker->VERSION('6.52'); 1 }; |
463
|
|
|
|
|
|
|
delete \$WriteMakefileArgs{MIN_PERL_VERSION} |
464
|
|
|
|
|
|
|
unless eval { ExtUtils::MakeMaker->VERSION('6.48'); 1 }; |
465
|
|
|
|
|
|
|
delete \$WriteMakefileArgs{LICENSE} |
466
|
|
|
|
|
|
|
unless eval { ExtUtils::MakeMaker->VERSION('6.31'); 1 }; |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
WriteMakefile(%WriteMakefileArgs); |
469
|
|
|
|
|
|
|
HERE |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
} |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
=head2 MI_Makefile_PL_guts( $main_module, $main_pm_file ) |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
This method is called by create_MI_Makefile_PL and returns text used to populate |
476
|
|
|
|
|
|
|
Makefile.PL; I<$main_pm_file> is the filename of the distribution's main |
477
|
|
|
|
|
|
|
module, I<$main_module>. |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
=cut |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
sub MI_Makefile_PL_guts { |
482
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
483
|
0
|
|
|
|
|
0
|
my $main_module = shift; |
484
|
0
|
|
|
|
|
0
|
my $main_pm_file = shift; |
485
|
|
|
|
|
|
|
|
486
|
0
|
|
|
|
|
0
|
my $author = "$self->{author} <$self->{email}>"; |
487
|
0
|
|
|
|
|
0
|
$author =~ s/'/\'/g; |
488
|
|
|
|
|
|
|
|
489
|
0
|
0
|
|
|
|
0
|
my $license_url = $self->{license_record} ? $self->{license_record}->url : ''; |
490
|
|
|
|
|
|
|
|
491
|
0
|
0
|
|
|
|
0
|
my $warnings = sprintf 'warnings%s;', ($self->{fatalize} ? " FATAL => 'all'" : ''); |
492
|
|
|
|
|
|
|
|
493
|
0
|
|
|
|
|
0
|
return <<"HERE"; |
494
|
|
|
|
|
|
|
use $self->{minperl}; |
495
|
|
|
|
|
|
|
use strict; |
496
|
|
|
|
|
|
|
use $warnings |
497
|
|
|
|
|
|
|
use inc::Module::Install; |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
name '$self->{distro}'; |
500
|
|
|
|
|
|
|
all_from '$main_pm_file'; |
501
|
|
|
|
|
|
|
author q{$author}; |
502
|
|
|
|
|
|
|
license '$self->{license}'; |
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
perl_version '$self->{minperl}'; |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
tests_recursive('t'); |
507
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
resources ( |
509
|
|
|
|
|
|
|
#homepage => 'http://yourwebsitehere.com', |
510
|
|
|
|
|
|
|
#IRC => 'irc://irc.perl.org/#$self->{distro}', |
511
|
|
|
|
|
|
|
license => '$license_url', |
512
|
|
|
|
|
|
|
#repository => 'git://github.com/$self->{author}/$self->{distro}.git', |
513
|
|
|
|
|
|
|
#repository => 'https://bitbucket.org/$self->{author}/$self->{distro}', |
514
|
|
|
|
|
|
|
bugtracker => 'https://rt.cpan.org/NoAuth/Bugs.html?Dist=$self->{distro}', |
515
|
|
|
|
|
|
|
); |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
configure_requires ( |
518
|
|
|
|
|
|
|
'Module::Install' => '0', |
519
|
|
|
|
|
|
|
); |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
test_requires ( |
522
|
|
|
|
|
|
|
'Test::More' => '0', |
523
|
|
|
|
|
|
|
); |
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
requires ( |
526
|
|
|
|
|
|
|
#'ABC' => '1.6', |
527
|
|
|
|
|
|
|
#'Foo::Bar::Module' => '5.0401', |
528
|
|
|
|
|
|
|
); |
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
install_as_cpan; |
531
|
|
|
|
|
|
|
auto_install; |
532
|
|
|
|
|
|
|
WriteAll; |
533
|
|
|
|
|
|
|
HERE |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
} |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
=head2 create_Build_PL( $main_module ) |
538
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
This will create the Build.PL for the distribution, and will use the module |
540
|
|
|
|
|
|
|
named in I<$main_module> as the main module of the distribution. |
541
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
=cut |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
sub create_Build_PL { |
545
|
24
|
|
|
24
|
1
|
46
|
my $self = shift; |
546
|
24
|
|
|
|
|
43
|
my $main_module = shift; |
547
|
24
|
|
|
|
|
53
|
my $builder_name = 'Module::Build'; |
548
|
24
|
|
|
|
|
86
|
my $output_file = |
549
|
|
|
|
|
|
|
Module::Starter::BuilderSet->new()->file_for_builder($builder_name); |
550
|
24
|
|
|
|
|
401
|
my $fname = File::Spec->catfile( $self->{basedir}, $output_file ); |
551
|
|
|
|
|
|
|
|
552
|
24
|
|
|
|
|
93
|
$self->create_file( |
553
|
|
|
|
|
|
|
$fname, |
554
|
|
|
|
|
|
|
$self->Build_PL_guts( |
555
|
|
|
|
|
|
|
$main_module, |
556
|
|
|
|
|
|
|
$self->_module_to_pm_file($main_module), |
557
|
|
|
|
|
|
|
), |
558
|
|
|
|
|
|
|
); |
559
|
|
|
|
|
|
|
|
560
|
24
|
|
|
|
|
216
|
$self->progress( "Created $fname" ); |
561
|
|
|
|
|
|
|
|
562
|
24
|
|
|
|
|
70
|
return $output_file; |
563
|
|
|
|
|
|
|
} |
564
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
=head2 Build_PL_guts( $main_module, $main_pm_file ) |
566
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
This method is called by create_Build_PL and returns text used to populate |
568
|
|
|
|
|
|
|
Build.PL; I<$main_pm_file> is the filename of the distribution's main module, |
569
|
|
|
|
|
|
|
I<$main_module>. |
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
=cut |
572
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
sub Build_PL_guts { |
574
|
24
|
|
|
24
|
1
|
51
|
my $self = shift; |
575
|
24
|
|
|
|
|
44
|
my $main_module = shift; |
576
|
24
|
|
|
|
|
54
|
my $main_pm_file = shift; |
577
|
|
|
|
|
|
|
|
578
|
24
|
|
|
|
|
103
|
(my $author = "$self->{author} <$self->{email}>") =~ s/'/\'/g; |
579
|
|
|
|
|
|
|
|
580
|
24
|
50
|
|
|
|
152
|
my $slname = $self->{license_record} ? $self->{license_record}->meta2_name : $self->{license}; |
581
|
|
|
|
|
|
|
|
582
|
24
|
50
|
|
|
|
180
|
my $warnings = sprintf 'warnings%s;', ($self->{fatalize} ? " FATAL => 'all'" : ''); |
583
|
|
|
|
|
|
|
|
584
|
24
|
|
|
|
|
237
|
return <<"HERE"; |
585
|
|
|
|
|
|
|
use $self->{minperl}; |
586
|
|
|
|
|
|
|
use strict; |
587
|
|
|
|
|
|
|
use $warnings |
588
|
|
|
|
|
|
|
use Module::Build; |
589
|
|
|
|
|
|
|
Module::Build->VERSION('0.4004'); |
590
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
my \$builder = Module::Build->new( |
592
|
|
|
|
|
|
|
module_name => '$main_module', |
593
|
|
|
|
|
|
|
license => '$slname', |
594
|
|
|
|
|
|
|
dist_author => q{$author}, |
595
|
|
|
|
|
|
|
dist_version_from => '$main_pm_file', |
596
|
|
|
|
|
|
|
release_status => 'stable', |
597
|
|
|
|
|
|
|
configure_requires => { |
598
|
|
|
|
|
|
|
'Module::Build' => '0.4004', |
599
|
|
|
|
|
|
|
}, |
600
|
|
|
|
|
|
|
test_requires => { |
601
|
|
|
|
|
|
|
'Test::More' => '0', |
602
|
|
|
|
|
|
|
}, |
603
|
|
|
|
|
|
|
requires => { |
604
|
|
|
|
|
|
|
#'ABC' => '1.6', |
605
|
|
|
|
|
|
|
#'Foo::Bar::Module' => '5.0401', |
606
|
|
|
|
|
|
|
}, |
607
|
|
|
|
|
|
|
add_to_cleanup => [ '$self->{distro}-*' ], |
608
|
|
|
|
|
|
|
); |
609
|
|
|
|
|
|
|
|
610
|
|
|
|
|
|
|
\$builder->create_build_script(); |
611
|
|
|
|
|
|
|
HERE |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
} |
614
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
=head2 create_Changes( ) |
616
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
This method creates a skeletal Changes file. |
618
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
=cut |
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
sub create_Changes { |
622
|
58
|
|
|
58
|
1
|
141
|
my $self = shift; |
623
|
|
|
|
|
|
|
|
624
|
58
|
|
|
|
|
748
|
my $fname = File::Spec->catfile( $self->{basedir}, 'Changes' ); |
625
|
58
|
|
|
|
|
306
|
$self->create_file( $fname, $self->Changes_guts() ); |
626
|
58
|
|
|
|
|
433
|
$self->progress( "Created $fname" ); |
627
|
|
|
|
|
|
|
|
628
|
58
|
|
|
|
|
199
|
return 'Changes'; |
629
|
|
|
|
|
|
|
} |
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
=head2 Changes_guts |
632
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
Called by create_Changes, this method returns content for the Changes file. |
634
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
=cut |
636
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
sub Changes_guts { |
638
|
58
|
|
|
58
|
1
|
107
|
my $self = shift; |
639
|
|
|
|
|
|
|
|
640
|
58
|
|
|
|
|
264
|
return <<"HERE"; |
641
|
|
|
|
|
|
|
Revision history for $self->{distro} |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
0.01 Date/time |
644
|
|
|
|
|
|
|
First version, released on an unsuspecting world. |
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
HERE |
647
|
|
|
|
|
|
|
} |
648
|
|
|
|
|
|
|
|
649
|
|
|
|
|
|
|
=head2 create_LICENSE |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
This method creates the distribution's LICENSE file. |
652
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
=cut |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
sub create_LICENSE { |
656
|
58
|
|
|
58
|
1
|
106
|
my $self = shift; |
657
|
|
|
|
|
|
|
|
658
|
58
|
|
50
|
|
|
203
|
my $record = $self->{license_record} || return (); |
659
|
58
|
|
|
|
|
869
|
my $fname = File::Spec->catfile( $self->{basedir}, 'LICENSE' ); |
660
|
58
|
|
|
|
|
393
|
$self->create_file( $fname, $record->license ); |
661
|
58
|
|
|
|
|
660
|
$self->progress( "Created $fname" ); |
662
|
|
|
|
|
|
|
|
663
|
58
|
|
|
|
|
192
|
return 'LICENSE'; |
664
|
|
|
|
|
|
|
} |
665
|
|
|
|
|
|
|
|
666
|
|
|
|
|
|
|
=head2 create_README( $build_instructions ) |
667
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
This method creates the distribution's README file. |
669
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
=cut |
671
|
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
sub create_README { |
673
|
58
|
|
|
58
|
1
|
113
|
my $self = shift; |
674
|
58
|
|
|
|
|
121
|
my $build_instructions = shift; |
675
|
|
|
|
|
|
|
|
676
|
58
|
|
|
|
|
703
|
my $fname = File::Spec->catfile( $self->{basedir}, 'README' ); |
677
|
58
|
|
|
|
|
298
|
$self->create_file( $fname, $self->README_guts($build_instructions) ); |
678
|
58
|
|
|
|
|
481
|
$self->progress( "Created $fname" ); |
679
|
|
|
|
|
|
|
|
680
|
58
|
|
|
|
|
179
|
return 'README'; |
681
|
|
|
|
|
|
|
} |
682
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
=head2 README_guts |
684
|
|
|
|
|
|
|
|
685
|
|
|
|
|
|
|
Called by create_README, this method returns content for the README file. |
686
|
|
|
|
|
|
|
|
687
|
|
|
|
|
|
|
=cut |
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
sub _README_intro { |
690
|
58
|
|
|
58
|
|
123
|
my $self = shift; |
691
|
|
|
|
|
|
|
|
692
|
58
|
|
|
|
|
161
|
return <<"HERE"; |
693
|
|
|
|
|
|
|
The README is used to introduce the module and provide instructions on |
694
|
|
|
|
|
|
|
how to install the module, any machine dependencies it may have (for |
695
|
|
|
|
|
|
|
example C compilers and installed libraries) and any other information |
696
|
|
|
|
|
|
|
that should be provided before the module is installed. |
697
|
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
A README file is required for CPAN modules since CPAN extracts the README |
699
|
|
|
|
|
|
|
file from a module distribution so that people browsing the archive |
700
|
|
|
|
|
|
|
can use it to get an idea of the module's uses. It is usually a good idea |
701
|
|
|
|
|
|
|
to provide version information here so that people can decide whether |
702
|
|
|
|
|
|
|
fixes for the module are worth downloading. |
703
|
|
|
|
|
|
|
HERE |
704
|
|
|
|
|
|
|
} |
705
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
sub _README_information { |
707
|
58
|
|
|
58
|
|
112
|
my $self = shift; |
708
|
|
|
|
|
|
|
|
709
|
58
|
|
|
|
|
147
|
my @reference_links = _reference_links(); |
710
|
|
|
|
|
|
|
|
711
|
58
|
|
|
|
|
157
|
my $content = "You can also look for information at:\n"; |
712
|
|
|
|
|
|
|
|
713
|
58
|
|
|
|
|
174
|
foreach my $ref (@reference_links){ |
714
|
232
|
|
|
|
|
339
|
my $title; |
715
|
232
|
100
|
|
|
|
556
|
$title = "$ref->{nickname}, " if exists $ref->{nickname}; |
716
|
232
|
|
|
|
|
366
|
$title .= $ref->{title}; |
717
|
232
|
|
|
|
|
597
|
my $link = sprintf($ref->{link}, $self->{distro}); |
718
|
|
|
|
|
|
|
|
719
|
232
|
|
|
|
|
737
|
$content .= qq[ |
720
|
|
|
|
|
|
|
$title |
721
|
|
|
|
|
|
|
$link |
722
|
|
|
|
|
|
|
]; |
723
|
|
|
|
|
|
|
} |
724
|
|
|
|
|
|
|
|
725
|
58
|
|
|
|
|
268
|
return $content; |
726
|
|
|
|
|
|
|
} |
727
|
|
|
|
|
|
|
|
728
|
|
|
|
|
|
|
sub _README_license { |
729
|
58
|
|
|
58
|
|
112
|
my $self = shift; |
730
|
|
|
|
|
|
|
|
731
|
58
|
|
|
|
|
156
|
my $license_blurb = $self->_license_blurb(); |
732
|
|
|
|
|
|
|
|
733
|
58
|
|
|
|
|
353
|
return <<"HERE"; |
734
|
|
|
|
|
|
|
LICENSE AND COPYRIGHT |
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
$license_blurb |
737
|
|
|
|
|
|
|
HERE |
738
|
|
|
|
|
|
|
} |
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
sub README_guts { |
741
|
58
|
|
|
58
|
1
|
149
|
my $self = shift; |
742
|
58
|
|
|
|
|
111
|
my $build_instructions = shift; |
743
|
|
|
|
|
|
|
|
744
|
58
|
|
|
|
|
188
|
my $intro = $self->_README_intro(); |
745
|
58
|
|
|
|
|
189
|
my $information = $self->_README_information(); |
746
|
58
|
|
|
|
|
194
|
my $license = $self->_README_license(); |
747
|
|
|
|
|
|
|
|
748
|
58
|
|
|
|
|
743
|
return <<"HERE"; |
749
|
|
|
|
|
|
|
$self->{distro} |
750
|
|
|
|
|
|
|
|
751
|
|
|
|
|
|
|
$intro |
752
|
|
|
|
|
|
|
|
753
|
|
|
|
|
|
|
INSTALLATION |
754
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
$build_instructions |
756
|
|
|
|
|
|
|
|
757
|
|
|
|
|
|
|
SUPPORT AND DOCUMENTATION |
758
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
After installing, you can find documentation for this module with the |
760
|
|
|
|
|
|
|
perldoc command. |
761
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
perldoc $self->{main_module} |
763
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
$information |
765
|
|
|
|
|
|
|
|
766
|
|
|
|
|
|
|
$license |
767
|
|
|
|
|
|
|
HERE |
768
|
|
|
|
|
|
|
} |
769
|
|
|
|
|
|
|
|
770
|
|
|
|
|
|
|
=head2 create_t( @modules ) |
771
|
|
|
|
|
|
|
|
772
|
|
|
|
|
|
|
This method creates a bunch of *.t files. I<@modules> is a list of all modules |
773
|
|
|
|
|
|
|
in the distribution. |
774
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
=cut |
776
|
|
|
|
|
|
|
|
777
|
|
|
|
|
|
|
sub create_t { |
778
|
58
|
|
|
58
|
1
|
119
|
my $self = shift; |
779
|
58
|
|
|
|
|
235
|
my @modules = @_; |
780
|
|
|
|
|
|
|
|
781
|
58
|
|
|
|
|
225
|
my %t_files = $self->t_guts(@modules); |
782
|
58
|
|
|
|
|
250
|
my %xt_files = $self->xt_guts(@modules); |
783
|
|
|
|
|
|
|
|
784
|
58
|
|
|
|
|
140
|
my @files; |
785
|
58
|
|
|
|
|
195
|
push @files, map { $self->_create_t('t', $_, $t_files{$_}) } keys %t_files; |
|
232
|
|
|
|
|
628
|
|
786
|
58
|
|
|
|
|
366
|
push @files, map { $self->_create_t('xt', $_, $xt_files{$_}) } keys %xt_files; |
|
58
|
|
|
|
|
261
|
|
787
|
|
|
|
|
|
|
|
788
|
58
|
|
|
|
|
464
|
return @files; |
789
|
|
|
|
|
|
|
} |
790
|
|
|
|
|
|
|
|
791
|
|
|
|
|
|
|
=head2 t_guts( @modules ) |
792
|
|
|
|
|
|
|
|
793
|
|
|
|
|
|
|
This method is called by create_t, and returns a description of the *.t files |
794
|
|
|
|
|
|
|
to be created. |
795
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
The return value is a hash of test files to create. Each key is a filename and |
797
|
|
|
|
|
|
|
each value is the contents of that file. |
798
|
|
|
|
|
|
|
|
799
|
|
|
|
|
|
|
=cut |
800
|
|
|
|
|
|
|
|
801
|
|
|
|
|
|
|
sub t_guts { |
802
|
58
|
|
|
58
|
1
|
135
|
my $self = shift; |
803
|
58
|
|
|
|
|
194
|
my @modules = @_; |
804
|
|
|
|
|
|
|
|
805
|
58
|
|
|
|
|
108
|
my %t_files; |
806
|
58
|
|
|
|
|
164
|
my $minperl = $self->{minperl}; |
807
|
58
|
50
|
|
|
|
309
|
my $warnings = sprintf 'warnings%s;', ($self->{fatalize} ? " FATAL => 'all'" : ''); |
808
|
|
|
|
|
|
|
|
809
|
58
|
|
|
|
|
283
|
my $header = <<"EOH"; |
810
|
|
|
|
|
|
|
#!perl -T |
811
|
|
|
|
|
|
|
use $minperl; |
812
|
|
|
|
|
|
|
use strict; |
813
|
|
|
|
|
|
|
use $warnings |
814
|
|
|
|
|
|
|
use Test::More; |
815
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
EOH |
817
|
|
|
|
|
|
|
|
818
|
58
|
|
|
|
|
248
|
$t_files{'pod.t'} = $header.<<'HERE'; |
819
|
|
|
|
|
|
|
unless ( $ENV{RELEASE_TESTING} ) { |
820
|
|
|
|
|
|
|
plan( skip_all => "Author tests not required for installation" ); |
821
|
|
|
|
|
|
|
} |
822
|
|
|
|
|
|
|
|
823
|
|
|
|
|
|
|
# Ensure a recent version of Test::Pod |
824
|
|
|
|
|
|
|
my $min_tp = 1.22; |
825
|
|
|
|
|
|
|
eval "use Test::Pod $min_tp"; |
826
|
|
|
|
|
|
|
plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; |
827
|
|
|
|
|
|
|
|
828
|
|
|
|
|
|
|
all_pod_files_ok(); |
829
|
|
|
|
|
|
|
HERE |
830
|
|
|
|
|
|
|
|
831
|
58
|
|
|
|
|
187
|
$t_files{'manifest.t'} = $header.<<'HERE'; |
832
|
|
|
|
|
|
|
unless ( $ENV{RELEASE_TESTING} ) { |
833
|
|
|
|
|
|
|
plan( skip_all => "Author tests not required for installation" ); |
834
|
|
|
|
|
|
|
} |
835
|
|
|
|
|
|
|
|
836
|
|
|
|
|
|
|
my $min_tcm = 0.9; |
837
|
|
|
|
|
|
|
eval "use Test::CheckManifest $min_tcm"; |
838
|
|
|
|
|
|
|
plan skip_all => "Test::CheckManifest $min_tcm required" if $@; |
839
|
|
|
|
|
|
|
|
840
|
|
|
|
|
|
|
ok_manifest(); |
841
|
|
|
|
|
|
|
HERE |
842
|
|
|
|
|
|
|
|
843
|
58
|
|
|
|
|
153
|
$t_files{'pod-coverage.t'} = $header.<<'HERE'; |
844
|
|
|
|
|
|
|
unless ( $ENV{RELEASE_TESTING} ) { |
845
|
|
|
|
|
|
|
plan( skip_all => "Author tests not required for installation" ); |
846
|
|
|
|
|
|
|
} |
847
|
|
|
|
|
|
|
|
848
|
|
|
|
|
|
|
# Ensure a recent version of Test::Pod::Coverage |
849
|
|
|
|
|
|
|
my $min_tpc = 1.08; |
850
|
|
|
|
|
|
|
eval "use Test::Pod::Coverage $min_tpc"; |
851
|
|
|
|
|
|
|
plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" |
852
|
|
|
|
|
|
|
if $@; |
853
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, |
855
|
|
|
|
|
|
|
# but older versions don't recognize some common documentation styles |
856
|
|
|
|
|
|
|
my $min_pc = 0.18; |
857
|
|
|
|
|
|
|
eval "use Pod::Coverage $min_pc"; |
858
|
|
|
|
|
|
|
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" |
859
|
|
|
|
|
|
|
if $@; |
860
|
|
|
|
|
|
|
|
861
|
|
|
|
|
|
|
all_pod_coverage_ok(); |
862
|
|
|
|
|
|
|
HERE |
863
|
|
|
|
|
|
|
|
864
|
58
|
|
|
|
|
140
|
my $nmodules = @modules; |
865
|
58
|
|
|
|
|
128
|
my $main_module = $modules[0]; |
866
|
|
|
|
|
|
|
my $use_lines = join( |
867
|
58
|
|
|
|
|
159
|
"\n", map { qq{ use_ok( '$_' ) || print "Bail out!\\n";} } @modules |
|
600
|
|
|
|
|
1651
|
|
868
|
|
|
|
|
|
|
); |
869
|
|
|
|
|
|
|
|
870
|
58
|
|
|
|
|
490
|
$t_files{'00-load.t'} = $header.<<"HERE"; |
871
|
|
|
|
|
|
|
plan tests => $nmodules; |
872
|
|
|
|
|
|
|
|
873
|
|
|
|
|
|
|
BEGIN { |
874
|
|
|
|
|
|
|
$use_lines |
875
|
|
|
|
|
|
|
} |
876
|
|
|
|
|
|
|
|
877
|
|
|
|
|
|
|
diag( "Testing $main_module \$${main_module}::VERSION, Perl \$], \$^X" ); |
878
|
|
|
|
|
|
|
HERE |
879
|
|
|
|
|
|
|
|
880
|
58
|
|
|
|
|
396
|
return %t_files; |
881
|
|
|
|
|
|
|
} |
882
|
|
|
|
|
|
|
|
883
|
|
|
|
|
|
|
=head2 xt_guts( @modules ) |
884
|
|
|
|
|
|
|
|
885
|
|
|
|
|
|
|
This method is called by create_t, and returns a description of the author |
886
|
|
|
|
|
|
|
only *.t files to be created in the xt directory. |
887
|
|
|
|
|
|
|
|
888
|
|
|
|
|
|
|
The return value is a hash of test files to create. Each key is a filename and |
889
|
|
|
|
|
|
|
each value is the contents of that file. |
890
|
|
|
|
|
|
|
|
891
|
|
|
|
|
|
|
=cut |
892
|
|
|
|
|
|
|
|
893
|
|
|
|
|
|
|
sub xt_guts { |
894
|
58
|
|
|
58
|
1
|
119
|
my $self = shift; |
895
|
58
|
|
|
|
|
205
|
my @modules = @_; |
896
|
|
|
|
|
|
|
|
897
|
58
|
|
|
|
|
108
|
my %xt_files; |
898
|
58
|
|
|
|
|
142
|
my $minperl = $self->{minperl}; |
899
|
58
|
50
|
|
|
|
228
|
my $warnings = sprintf 'warnings%s;', ($self->{fatalize} ? " FATAL => 'all'" : ''); |
900
|
|
|
|
|
|
|
|
901
|
58
|
|
|
|
|
200
|
my $header = <<"EOH"; |
902
|
|
|
|
|
|
|
#!perl -T |
903
|
|
|
|
|
|
|
use $minperl; |
904
|
|
|
|
|
|
|
use strict; |
905
|
|
|
|
|
|
|
use $warnings |
906
|
|
|
|
|
|
|
use Test::More; |
907
|
|
|
|
|
|
|
|
908
|
|
|
|
|
|
|
EOH |
909
|
|
|
|
|
|
|
|
910
|
58
|
|
|
|
|
99
|
my $module_boilerplate_tests; |
911
|
|
|
|
|
|
|
$module_boilerplate_tests .= |
912
|
58
|
|
|
|
|
264
|
" module_boilerplate_ok('".$self->_module_to_pm_file($_)."');\n" for @modules; |
913
|
|
|
|
|
|
|
|
914
|
58
|
|
|
|
|
138
|
my $boilerplate_tests = @modules + 2; |
915
|
58
|
|
|
|
|
421
|
$xt_files{'boilerplate.t'} = $header.<<"HERE"; |
916
|
|
|
|
|
|
|
plan tests => $boilerplate_tests; |
917
|
|
|
|
|
|
|
|
918
|
|
|
|
|
|
|
sub not_in_file_ok { |
919
|
|
|
|
|
|
|
my (\$filename, \%regex) = \@_; |
920
|
|
|
|
|
|
|
open( my \$fh, '<', \$filename ) |
921
|
|
|
|
|
|
|
or die "couldn't open \$filename for reading: \$!"; |
922
|
|
|
|
|
|
|
|
923
|
|
|
|
|
|
|
my \%violated; |
924
|
|
|
|
|
|
|
|
925
|
|
|
|
|
|
|
while (my \$line = <\$fh>) { |
926
|
|
|
|
|
|
|
while (my (\$desc, \$regex) = each \%regex) { |
927
|
|
|
|
|
|
|
if (\$line =~ \$regex) { |
928
|
|
|
|
|
|
|
push \@{\$violated{\$desc}||=[]}, \$.; |
929
|
|
|
|
|
|
|
} |
930
|
|
|
|
|
|
|
} |
931
|
|
|
|
|
|
|
} |
932
|
|
|
|
|
|
|
|
933
|
|
|
|
|
|
|
if (\%violated) { |
934
|
|
|
|
|
|
|
fail("\$filename contains boilerplate text"); |
935
|
|
|
|
|
|
|
diag "\$_ appears on lines \@{\$violated{\$_}}" for keys \%violated; |
936
|
|
|
|
|
|
|
} else { |
937
|
|
|
|
|
|
|
pass("\$filename contains no boilerplate text"); |
938
|
|
|
|
|
|
|
} |
939
|
|
|
|
|
|
|
} |
940
|
|
|
|
|
|
|
|
941
|
|
|
|
|
|
|
sub module_boilerplate_ok { |
942
|
|
|
|
|
|
|
my (\$module) = \@_; |
943
|
|
|
|
|
|
|
not_in_file_ok(\$module => |
944
|
|
|
|
|
|
|
'the great new \$MODULENAME' => qr/ - The great new /, |
945
|
|
|
|
|
|
|
'boilerplate description' => qr/Quick summary of what the module/, |
946
|
|
|
|
|
|
|
'stub function definition' => qr/function[12]/, |
947
|
|
|
|
|
|
|
); |
948
|
|
|
|
|
|
|
} |
949
|
|
|
|
|
|
|
|
950
|
|
|
|
|
|
|
TODO: { |
951
|
|
|
|
|
|
|
local \$TODO = "Need to replace the boilerplate text"; |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
not_in_file_ok(README => |
954
|
|
|
|
|
|
|
"The README is used..." => qr/The README is used/, |
955
|
|
|
|
|
|
|
"'version information here'" => qr/to provide version information/, |
956
|
|
|
|
|
|
|
); |
957
|
|
|
|
|
|
|
|
958
|
|
|
|
|
|
|
not_in_file_ok(Changes => |
959
|
|
|
|
|
|
|
"placeholder date/time" => qr(Date/time) |
960
|
|
|
|
|
|
|
); |
961
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
$module_boilerplate_tests |
963
|
|
|
|
|
|
|
|
964
|
|
|
|
|
|
|
} |
965
|
|
|
|
|
|
|
|
966
|
|
|
|
|
|
|
HERE |
967
|
|
|
|
|
|
|
|
968
|
58
|
|
|
|
|
280
|
return %xt_files; |
969
|
|
|
|
|
|
|
} |
970
|
|
|
|
|
|
|
|
971
|
|
|
|
|
|
|
sub _create_t { |
972
|
290
|
|
|
290
|
|
460
|
my $self = shift; |
973
|
290
|
|
|
|
|
444
|
my $directory = shift; # 't' or 'xt' |
974
|
290
|
|
|
|
|
384
|
my $filename = shift; |
975
|
290
|
|
|
|
|
439
|
my $content = shift; |
976
|
|
|
|
|
|
|
|
977
|
290
|
|
|
|
|
692
|
my @dirparts = ( $self->{basedir}, $directory ); |
978
|
290
|
|
|
|
|
2314
|
my $tdir = File::Spec->catdir( @dirparts ); |
979
|
290
|
100
|
|
|
|
5537
|
if ( not -d $tdir ) { |
980
|
116
|
|
|
|
|
550
|
local @ARGV = $tdir; |
981
|
116
|
|
|
|
|
526
|
mkpath(); |
982
|
116
|
|
|
|
|
14806
|
$self->progress( "Created $tdir" ); |
983
|
|
|
|
|
|
|
} |
984
|
|
|
|
|
|
|
|
985
|
290
|
|
|
|
|
3020
|
my $fname = File::Spec->catfile( @dirparts, $filename ); |
986
|
290
|
|
|
|
|
1080
|
$self->create_file( $fname, $content ); |
987
|
290
|
|
|
|
|
1606
|
$self->progress( "Created $fname" ); |
988
|
|
|
|
|
|
|
|
989
|
290
|
|
|
|
|
1628
|
return join('/', $directory, $filename ); |
990
|
|
|
|
|
|
|
} |
991
|
|
|
|
|
|
|
|
992
|
|
|
|
|
|
|
=head2 create_MB_MANIFEST |
993
|
|
|
|
|
|
|
|
994
|
|
|
|
|
|
|
This methods creates a MANIFEST file using Module::Build's methods. |
995
|
|
|
|
|
|
|
|
996
|
|
|
|
|
|
|
=cut |
997
|
|
|
|
|
|
|
|
998
|
|
|
|
|
|
|
sub create_MB_MANIFEST { |
999
|
2
|
|
|
2
|
1
|
5
|
my $self = shift; |
1000
|
2
|
|
|
|
|
7
|
$self->create_EUMM_MANIFEST; |
1001
|
|
|
|
|
|
|
} |
1002
|
|
|
|
|
|
|
|
1003
|
|
|
|
|
|
|
=head2 create_MI_MANIFEST |
1004
|
|
|
|
|
|
|
|
1005
|
|
|
|
|
|
|
This method creates a MANIFEST file using Module::Install's methods. |
1006
|
|
|
|
|
|
|
|
1007
|
|
|
|
|
|
|
Currently runs ExtUtils::MakeMaker's methods. |
1008
|
|
|
|
|
|
|
|
1009
|
|
|
|
|
|
|
=cut |
1010
|
|
|
|
|
|
|
|
1011
|
|
|
|
|
|
|
sub create_MI_MANIFEST { |
1012
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
1013
|
0
|
|
|
|
|
0
|
$self->create_EUMM_MANIFEST; |
1014
|
|
|
|
|
|
|
} |
1015
|
|
|
|
|
|
|
|
1016
|
|
|
|
|
|
|
=head2 create_EUMM_MANIFEST |
1017
|
|
|
|
|
|
|
|
1018
|
|
|
|
|
|
|
This method creates a MANIFEST file using ExtUtils::MakeMaker's methods. |
1019
|
|
|
|
|
|
|
|
1020
|
|
|
|
|
|
|
=cut |
1021
|
|
|
|
|
|
|
|
1022
|
|
|
|
|
|
|
sub create_EUMM_MANIFEST { |
1023
|
2
|
|
|
2
|
1
|
4
|
my $self = shift; |
1024
|
2
|
|
|
|
|
6640
|
my $orig_dir = cwd(); |
1025
|
|
|
|
|
|
|
|
1026
|
|
|
|
|
|
|
# create the MANIFEST in the correct path |
1027
|
2
|
50
|
|
|
|
91
|
chdir $self->{'basedir'} || die "Can't reach basedir: $!\n"; |
1028
|
|
|
|
|
|
|
|
1029
|
2
|
|
|
|
|
984
|
require ExtUtils::Manifest; |
1030
|
2
|
|
|
|
|
9317
|
$ExtUtils::Manifest::Quiet = 0; |
1031
|
2
|
|
|
|
|
32
|
ExtUtils::Manifest::mkmanifest(); |
1032
|
|
|
|
|
|
|
|
1033
|
|
|
|
|
|
|
# return to our original path, wherever it was |
1034
|
2
|
50
|
|
|
|
9922
|
chdir $orig_dir || die "Can't return to original dir: $!\n"; |
1035
|
|
|
|
|
|
|
} |
1036
|
|
|
|
|
|
|
|
1037
|
|
|
|
|
|
|
=head2 create_MANIFEST( $method ) |
1038
|
|
|
|
|
|
|
|
1039
|
|
|
|
|
|
|
This method creates the distribution's MANIFEST file. It must be run last, |
1040
|
|
|
|
|
|
|
because all the other create_* functions have been returning the functions they |
1041
|
|
|
|
|
|
|
create. |
1042
|
|
|
|
|
|
|
|
1043
|
|
|
|
|
|
|
It receives a method to run in order to create the MANIFEST file. That way it |
1044
|
|
|
|
|
|
|
can create a MANIFEST file according to the builder used. |
1045
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
=cut |
1047
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
sub create_MANIFEST { |
1049
|
2
|
|
|
2
|
1
|
7
|
my ( $self, $manifest_method ) = @_; |
1050
|
2
|
|
|
|
|
26
|
my $fname = File::Spec->catfile( $self->{basedir}, 'MANIFEST' ); |
1051
|
|
|
|
|
|
|
|
1052
|
2
|
|
|
|
|
11
|
$self->$manifest_method(); |
1053
|
2
|
|
|
|
|
50
|
$self->filter_lines_in_file( |
1054
|
|
|
|
|
|
|
$fname, |
1055
|
|
|
|
|
|
|
qr/^xt\/boilerplate\.t$/, |
1056
|
|
|
|
|
|
|
qr/^ignore\.txt$/, |
1057
|
|
|
|
|
|
|
); |
1058
|
|
|
|
|
|
|
|
1059
|
2
|
|
|
|
|
29
|
$self->progress( "Created $fname" ); |
1060
|
|
|
|
|
|
|
|
1061
|
2
|
|
|
|
|
12
|
return 'MANIFEST'; |
1062
|
|
|
|
|
|
|
} |
1063
|
|
|
|
|
|
|
|
1064
|
|
|
|
|
|
|
=head2 get_builders( ) |
1065
|
|
|
|
|
|
|
|
1066
|
|
|
|
|
|
|
This methods gets the correct builder(s). |
1067
|
|
|
|
|
|
|
|
1068
|
|
|
|
|
|
|
It is called by C, and returns an arrayref with the builders. |
1069
|
|
|
|
|
|
|
|
1070
|
|
|
|
|
|
|
=cut |
1071
|
|
|
|
|
|
|
|
1072
|
|
|
|
|
|
|
sub get_builders { |
1073
|
58
|
|
|
58
|
1
|
118
|
my $self = shift; |
1074
|
|
|
|
|
|
|
|
1075
|
|
|
|
|
|
|
# pass one: pull the builders out of $self->{builder} |
1076
|
|
|
|
|
|
|
my @tmp = |
1077
|
0
|
|
|
|
|
0
|
ref $self->{'builder'} eq 'ARRAY' ? @{ $self->{'builder'} } |
1078
|
58
|
50
|
|
|
|
310
|
: $self->{'builder'}; |
1079
|
|
|
|
|
|
|
|
1080
|
58
|
|
|
|
|
96
|
my @builders; |
1081
|
58
|
|
|
|
|
122
|
my $COMMA = q{,}; |
1082
|
|
|
|
|
|
|
# pass two: expand comma-delimited builder lists |
1083
|
58
|
|
|
|
|
159
|
foreach my $builder (@tmp) { |
1084
|
58
|
|
|
|
|
1316
|
push( @builders, split( $COMMA, $builder ) ); |
1085
|
|
|
|
|
|
|
} |
1086
|
|
|
|
|
|
|
|
1087
|
58
|
|
|
|
|
263
|
return \@builders; |
1088
|
|
|
|
|
|
|
} |
1089
|
|
|
|
|
|
|
|
1090
|
|
|
|
|
|
|
=head2 create_build( ) |
1091
|
|
|
|
|
|
|
|
1092
|
|
|
|
|
|
|
This method creates the build file(s) and puts together some build |
1093
|
|
|
|
|
|
|
instructions. The builders currently supported are: |
1094
|
|
|
|
|
|
|
|
1095
|
|
|
|
|
|
|
ExtUtils::MakeMaker |
1096
|
|
|
|
|
|
|
Module::Build |
1097
|
|
|
|
|
|
|
Module::Install |
1098
|
|
|
|
|
|
|
|
1099
|
|
|
|
|
|
|
=cut |
1100
|
|
|
|
|
|
|
|
1101
|
|
|
|
|
|
|
sub create_build { |
1102
|
58
|
|
|
58
|
1
|
115
|
my $self = shift; |
1103
|
|
|
|
|
|
|
|
1104
|
|
|
|
|
|
|
# get the builders |
1105
|
58
|
|
|
|
|
95
|
my @builders = @{ $self->get_builders }; |
|
58
|
|
|
|
|
196
|
|
1106
|
58
|
|
|
|
|
685
|
my $builder_set = Module::Starter::BuilderSet->new(); |
1107
|
|
|
|
|
|
|
|
1108
|
|
|
|
|
|
|
# Remove mutually exclusive and unsupported builders |
1109
|
58
|
|
|
|
|
275
|
@builders = $builder_set->check_compatibility( @builders ); |
1110
|
|
|
|
|
|
|
|
1111
|
|
|
|
|
|
|
# compile some build instructions, create a list of files generated |
1112
|
|
|
|
|
|
|
# by the builders' create_* methods, and call said methods |
1113
|
|
|
|
|
|
|
|
1114
|
58
|
|
|
|
|
223
|
my @build_instructions; |
1115
|
|
|
|
|
|
|
my @files; |
1116
|
58
|
|
|
|
|
0
|
my $manifest_method; |
1117
|
|
|
|
|
|
|
|
1118
|
58
|
|
|
|
|
136
|
foreach my $builder ( @builders ) { |
1119
|
58
|
50
|
|
|
|
147
|
if ( !@build_instructions ) { |
1120
|
58
|
|
|
|
|
147
|
push( @build_instructions, |
1121
|
|
|
|
|
|
|
'To install this module, run the following commands:' |
1122
|
|
|
|
|
|
|
); |
1123
|
|
|
|
|
|
|
} |
1124
|
|
|
|
|
|
|
else { |
1125
|
0
|
|
|
|
|
0
|
push( @build_instructions, |
1126
|
|
|
|
|
|
|
"Alternatively, to install with $builder, you can ". |
1127
|
|
|
|
|
|
|
"use the following commands:" |
1128
|
|
|
|
|
|
|
); |
1129
|
|
|
|
|
|
|
} |
1130
|
58
|
|
|
|
|
201
|
push( @files, $builder_set->file_for_builder($builder) ); |
1131
|
58
|
|
|
|
|
223
|
my @commands = $builder_set->instructions_for_builder($builder); |
1132
|
58
|
|
|
|
|
193
|
push( @build_instructions, join("\n", map { "\t$_" } @commands) ); |
|
232
|
|
|
|
|
600
|
|
1133
|
|
|
|
|
|
|
|
1134
|
58
|
|
|
|
|
278
|
my $build_method = $builder_set->method_for_builder($builder); |
1135
|
58
|
|
|
|
|
376
|
$self->$build_method($self->{main_module}); |
1136
|
|
|
|
|
|
|
|
1137
|
58
|
|
|
|
|
336
|
$manifest_method = $builder_set->manifest_method($builder); |
1138
|
|
|
|
|
|
|
} |
1139
|
|
|
|
|
|
|
|
1140
|
|
|
|
|
|
|
return( |
1141
|
58
|
|
|
|
|
951
|
files => [ @files ], |
1142
|
|
|
|
|
|
|
instructions => join( "\n\n", @build_instructions ), |
1143
|
|
|
|
|
|
|
manifest_method => $manifest_method, |
1144
|
|
|
|
|
|
|
); |
1145
|
|
|
|
|
|
|
} |
1146
|
|
|
|
|
|
|
|
1147
|
|
|
|
|
|
|
|
1148
|
|
|
|
|
|
|
=head2 create_ignores() |
1149
|
|
|
|
|
|
|
|
1150
|
|
|
|
|
|
|
This creates a text file for use as MANIFEST.SKIP, .cvsignore, |
1151
|
|
|
|
|
|
|
.gitignore, or whatever you use. |
1152
|
|
|
|
|
|
|
|
1153
|
|
|
|
|
|
|
=cut |
1154
|
|
|
|
|
|
|
|
1155
|
|
|
|
|
|
|
sub create_ignores { |
1156
|
58
|
|
|
58
|
1
|
106
|
my $self = shift; |
1157
|
58
|
|
|
|
|
169
|
my $type = $self->{ignores_type}; |
1158
|
58
|
|
|
|
|
467
|
my %names = ( |
1159
|
|
|
|
|
|
|
generic => 'ignore.txt', |
1160
|
|
|
|
|
|
|
cvs => '.cvsignore', |
1161
|
|
|
|
|
|
|
git => '.gitignore', |
1162
|
|
|
|
|
|
|
hg => '.hgignore', |
1163
|
|
|
|
|
|
|
manifest => 'MANIFEST.SKIP', |
1164
|
|
|
|
|
|
|
); |
1165
|
|
|
|
|
|
|
|
1166
|
|
|
|
|
|
|
my $create_file = sub { |
1167
|
226
|
|
|
226
|
|
419
|
my $type = shift; |
1168
|
226
|
|
|
|
|
425
|
my $name = $names{$type}; |
1169
|
226
|
|
|
|
|
2538
|
my $fname = File::Spec->catfile( $self->{basedir}, $names{$type} ); |
1170
|
226
|
|
|
|
|
740
|
$self->create_file( $fname, $self->ignores_guts($type) ); |
1171
|
226
|
|
|
|
|
1289
|
$self->progress( "Created $fname" ); |
1172
|
58
|
|
|
|
|
398
|
}; |
1173
|
|
|
|
|
|
|
|
1174
|
58
|
50
|
|
|
|
242
|
if ( ref $type eq 'ARRAY' ) { |
|
|
0
|
|
|
|
|
|
1175
|
58
|
|
|
|
|
107
|
foreach my $single_type ( @{$type} ) { |
|
58
|
|
|
|
|
207
|
|
1176
|
226
|
|
|
|
|
508
|
$create_file->($single_type); |
1177
|
|
|
|
|
|
|
} |
1178
|
|
|
|
|
|
|
} elsif ( ! ref $type ) { |
1179
|
0
|
|
|
|
|
0
|
$create_file->($type); |
1180
|
|
|
|
|
|
|
} |
1181
|
|
|
|
|
|
|
|
1182
|
58
|
|
|
|
|
494
|
return; # Not a file that goes in the MANIFEST |
1183
|
|
|
|
|
|
|
} |
1184
|
|
|
|
|
|
|
|
1185
|
|
|
|
|
|
|
=head2 ignores_guts() |
1186
|
|
|
|
|
|
|
|
1187
|
|
|
|
|
|
|
Called by C, this method returns the contents of the |
1188
|
|
|
|
|
|
|
ignore file. |
1189
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
=cut |
1191
|
|
|
|
|
|
|
|
1192
|
|
|
|
|
|
|
sub ignores_guts { |
1193
|
226
|
|
|
226
|
1
|
531
|
my ($self, $type) = @_; |
1194
|
|
|
|
|
|
|
|
1195
|
226
|
100
|
|
|
|
544
|
my $ms = $self->{manifest_skip} ? "MANIFEST\nMANIFEST.bak\n" : ''; |
1196
|
226
|
|
|
|
|
1039
|
my $guts = { |
1197
|
|
|
|
|
|
|
generic => $ms.<<"EOF", |
1198
|
|
|
|
|
|
|
Makefile |
1199
|
|
|
|
|
|
|
Makefile.old |
1200
|
|
|
|
|
|
|
Build |
1201
|
|
|
|
|
|
|
Build.bat |
1202
|
|
|
|
|
|
|
META.* |
1203
|
|
|
|
|
|
|
MYMETA.* |
1204
|
|
|
|
|
|
|
.build/ |
1205
|
|
|
|
|
|
|
_build/ |
1206
|
|
|
|
|
|
|
cover_db/ |
1207
|
|
|
|
|
|
|
blib/ |
1208
|
|
|
|
|
|
|
inc/ |
1209
|
|
|
|
|
|
|
.lwpcookies |
1210
|
|
|
|
|
|
|
.last_cover_stats |
1211
|
|
|
|
|
|
|
nytprof.out |
1212
|
|
|
|
|
|
|
pod2htm*.tmp |
1213
|
|
|
|
|
|
|
pm_to_blib |
1214
|
|
|
|
|
|
|
$self->{distro}-* |
1215
|
|
|
|
|
|
|
$self->{distro}-*.tar.gz |
1216
|
|
|
|
|
|
|
EOF |
1217
|
|
|
|
|
|
|
# make this more restrictive, since MANIFEST tends to be less noticeable |
1218
|
|
|
|
|
|
|
# (also, manifest supports REs.) |
1219
|
|
|
|
|
|
|
manifest => <<'EOF', |
1220
|
|
|
|
|
|
|
# Top-level filter (only include the following...) |
1221
|
|
|
|
|
|
|
^(?!(?:script|examples|lib|inc|t|xt|maint)/|(?:(?:Makefile|Build)\.PL|README|LICENSE|MANIFEST|Changes|META\.(?:yml|json))$) |
1222
|
|
|
|
|
|
|
|
1223
|
|
|
|
|
|
|
# Avoid version control files. |
1224
|
|
|
|
|
|
|
\bRCS\b |
1225
|
|
|
|
|
|
|
\bCVS\b |
1226
|
|
|
|
|
|
|
,v$ |
1227
|
|
|
|
|
|
|
\B\.svn\b |
1228
|
|
|
|
|
|
|
\b_darcs\b |
1229
|
|
|
|
|
|
|
# (.git or .hg only in top-level, hence it's blocked above) |
1230
|
|
|
|
|
|
|
|
1231
|
|
|
|
|
|
|
# Avoid temp and backup files. |
1232
|
|
|
|
|
|
|
~$ |
1233
|
|
|
|
|
|
|
\.tmp$ |
1234
|
|
|
|
|
|
|
\.old$ |
1235
|
|
|
|
|
|
|
\.bak$ |
1236
|
|
|
|
|
|
|
\..*?\.sw[po]$ |
1237
|
|
|
|
|
|
|
\#$ |
1238
|
|
|
|
|
|
|
\b\.# |
1239
|
|
|
|
|
|
|
|
1240
|
|
|
|
|
|
|
# avoid OS X finder files |
1241
|
|
|
|
|
|
|
\.DS_Store$ |
1242
|
|
|
|
|
|
|
|
1243
|
|
|
|
|
|
|
# ditto for Windows |
1244
|
|
|
|
|
|
|
\bdesktop\.ini$ |
1245
|
|
|
|
|
|
|
\b[Tt]humbs\.db$ |
1246
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
# Avoid patch remnants |
1248
|
|
|
|
|
|
|
\.orig$ |
1249
|
|
|
|
|
|
|
\.rej$ |
1250
|
|
|
|
|
|
|
EOF |
1251
|
|
|
|
|
|
|
}; |
1252
|
226
|
|
|
|
|
599
|
$guts->{hg} = $guts->{cvs} = $guts->{git} = $guts->{generic}; |
1253
|
|
|
|
|
|
|
|
1254
|
226
|
|
|
|
|
918
|
return $guts->{$type}; |
1255
|
|
|
|
|
|
|
} |
1256
|
|
|
|
|
|
|
|
1257
|
|
|
|
|
|
|
=head1 HELPER METHODS |
1258
|
|
|
|
|
|
|
|
1259
|
|
|
|
|
|
|
=head2 verbose |
1260
|
|
|
|
|
|
|
|
1261
|
|
|
|
|
|
|
C tells us whether we're in verbose mode. |
1262
|
|
|
|
|
|
|
|
1263
|
|
|
|
|
|
|
=cut |
1264
|
|
|
|
|
|
|
|
1265
|
2003
|
|
|
2003
|
1
|
5459
|
sub verbose { return shift->{verbose} } |
1266
|
|
|
|
|
|
|
|
1267
|
|
|
|
|
|
|
=head2 create_file( $fname, @content_lines ) |
1268
|
|
|
|
|
|
|
|
1269
|
|
|
|
|
|
|
Creates I<$fname>, dumps I<@content_lines> in it, and closes it. |
1270
|
|
|
|
|
|
|
Dies on any error. |
1271
|
|
|
|
|
|
|
|
1272
|
|
|
|
|
|
|
=cut |
1273
|
|
|
|
|
|
|
|
1274
|
|
|
|
|
|
|
sub create_file { |
1275
|
1348
|
|
|
1348
|
1
|
410333
|
my $self = shift; |
1276
|
1348
|
|
|
|
|
1991
|
my $fname = shift; |
1277
|
|
|
|
|
|
|
|
1278
|
1348
|
|
|
|
|
2843
|
my @content = @_; |
1279
|
1348
|
50
|
|
|
|
86397
|
open( my $fh, '>', $fname ) or confess "Can't create $fname: $!\n"; |
1280
|
1348
|
|
|
|
|
4315
|
print {$fh} @content; |
|
1348
|
|
|
|
|
15756
|
|
1281
|
1348
|
50
|
|
|
|
38203
|
close $fh or die "Can't close $fname: $!\n"; |
1282
|
|
|
|
|
|
|
|
1283
|
1348
|
|
|
|
|
8222
|
return; |
1284
|
|
|
|
|
|
|
} |
1285
|
|
|
|
|
|
|
|
1286
|
|
|
|
|
|
|
=head2 progress( @list ) |
1287
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
C |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
=cut |
1291
|
|
|
|
|
|
|
|
1292
|
|
|
|
|
|
|
sub progress { |
1293
|
2003
|
|
|
2003
|
1
|
4324
|
my $self = shift; |
1294
|
2003
|
50
|
|
|
|
4419
|
print @_, "\n" if $self->verbose; |
1295
|
|
|
|
|
|
|
|
1296
|
2003
|
|
|
|
|
4232
|
return; |
1297
|
|
|
|
|
|
|
} |
1298
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
=head2 filter_lines_in_file( $filename, @compiled_regexes ) |
1300
|
|
|
|
|
|
|
|
1301
|
|
|
|
|
|
|
C goes over a file and removes lines with the received |
1302
|
|
|
|
|
|
|
regexes. |
1303
|
|
|
|
|
|
|
|
1304
|
|
|
|
|
|
|
For example, removing t/boilerplate.t in the MANIFEST. |
1305
|
|
|
|
|
|
|
|
1306
|
|
|
|
|
|
|
=cut |
1307
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
sub filter_lines_in_file { |
1309
|
2
|
|
|
2
|
1
|
108
|
my ( $self, $file, @regexes ) = @_; |
1310
|
2
|
|
|
|
|
10
|
my @read_lines; |
1311
|
2
|
50
|
|
|
|
103
|
open my $fh, '<', $file or die "Can't open file $file: $!\n"; |
1312
|
2
|
|
|
|
|
106
|
@read_lines = <$fh>; |
1313
|
2
|
50
|
|
|
|
31
|
close $fh or die "Can't close file $file: $!\n"; |
1314
|
|
|
|
|
|
|
|
1315
|
2
|
|
|
|
|
8
|
chomp @read_lines; |
1316
|
|
|
|
|
|
|
|
1317
|
2
|
50
|
|
|
|
132
|
open $fh, '>', $file or die "Can't open file $file: $!\n"; |
1318
|
2
|
|
|
|
|
20
|
foreach my $line (@read_lines) { |
1319
|
28
|
|
|
|
|
36
|
my $found; |
1320
|
|
|
|
|
|
|
|
1321
|
28
|
|
|
|
|
44
|
foreach my $regex (@regexes) { |
1322
|
56
|
100
|
|
|
|
208
|
if ( $line =~ $regex ) { |
1323
|
4
|
|
|
|
|
12
|
$found++; |
1324
|
|
|
|
|
|
|
} |
1325
|
|
|
|
|
|
|
} |
1326
|
|
|
|
|
|
|
|
1327
|
28
|
100
|
|
|
|
69
|
$found or print {$fh} "$line\n"; |
|
24
|
|
|
|
|
64
|
|
1328
|
|
|
|
|
|
|
} |
1329
|
2
|
50
|
|
|
|
183
|
close $fh or die "Can't close file $file: $!\n"; |
1330
|
|
|
|
|
|
|
} |
1331
|
|
|
|
|
|
|
|
1332
|
|
|
|
|
|
|
=head1 BUGS |
1333
|
|
|
|
|
|
|
|
1334
|
|
|
|
|
|
|
Please report any bugs or feature requests to the bugtracker for this project |
1335
|
|
|
|
|
|
|
on GitHub at: L. I will be |
1336
|
|
|
|
|
|
|
notified, and then you'll automatically be notified of progress on your bug |
1337
|
|
|
|
|
|
|
as I make changes. |
1338
|
|
|
|
|
|
|
|
1339
|
|
|
|
|
|
|
=head1 AUTHOR |
1340
|
|
|
|
|
|
|
|
1341
|
|
|
|
|
|
|
Sawyer X, C<< >> |
1342
|
|
|
|
|
|
|
|
1343
|
|
|
|
|
|
|
Andy Lester, C<< >> |
1344
|
|
|
|
|
|
|
|
1345
|
|
|
|
|
|
|
C.J. Adams-Collier, C<< >> |
1346
|
|
|
|
|
|
|
|
1347
|
|
|
|
|
|
|
=head1 Copyright & License |
1348
|
|
|
|
|
|
|
|
1349
|
|
|
|
|
|
|
Copyright 2005-2009 Andy Lester and C.J. Adams-Collier, All Rights Reserved. |
1350
|
|
|
|
|
|
|
|
1351
|
|
|
|
|
|
|
Copyright 2010 Sawyer X, All Rights Reserved. |
1352
|
|
|
|
|
|
|
|
1353
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
1354
|
|
|
|
|
|
|
under the same terms as Perl itself. |
1355
|
|
|
|
|
|
|
|
1356
|
|
|
|
|
|
|
Please note that these modules are not products of or supported by the |
1357
|
|
|
|
|
|
|
employers of the various contributors to the code. |
1358
|
|
|
|
|
|
|
|
1359
|
|
|
|
|
|
|
=cut |
1360
|
|
|
|
|
|
|
|
1361
|
|
|
|
|
|
|
sub _module_header { |
1362
|
600
|
|
|
600
|
|
864
|
my $self = shift; |
1363
|
600
|
|
|
|
|
883
|
my $module = shift; |
1364
|
600
|
|
|
|
|
833
|
my $rtname = shift; |
1365
|
600
|
50
|
|
|
|
2979
|
my $warnings = sprintf 'warnings%s;', ($self->{fatalize} ? " FATAL => 'all'" : ''); |
1366
|
|
|
|
|
|
|
|
1367
|
600
|
|
|
|
|
3314
|
my $content = <<"HERE"; |
1368
|
|
|
|
|
|
|
package $module; |
1369
|
|
|
|
|
|
|
|
1370
|
|
|
|
|
|
|
use $self->{minperl}; |
1371
|
|
|
|
|
|
|
use strict; |
1372
|
|
|
|
|
|
|
use $warnings |
1373
|
|
|
|
|
|
|
|
1374
|
|
|
|
|
|
|
\=head1 NAME |
1375
|
|
|
|
|
|
|
|
1376
|
|
|
|
|
|
|
$module - The great new $module! |
1377
|
|
|
|
|
|
|
|
1378
|
|
|
|
|
|
|
\=head1 VERSION |
1379
|
|
|
|
|
|
|
|
1380
|
|
|
|
|
|
|
Version 0.01 |
1381
|
|
|
|
|
|
|
|
1382
|
|
|
|
|
|
|
\=cut |
1383
|
|
|
|
|
|
|
|
1384
|
|
|
|
|
|
|
our \$VERSION = '0.01'; |
1385
|
|
|
|
|
|
|
HERE |
1386
|
600
|
|
|
|
|
1370
|
return $content; |
1387
|
|
|
|
|
|
|
} |
1388
|
|
|
|
|
|
|
|
1389
|
|
|
|
|
|
|
sub _module_bugs { |
1390
|
600
|
|
|
600
|
|
936
|
my $self = shift; |
1391
|
600
|
|
|
|
|
950
|
my $module = shift; |
1392
|
600
|
|
|
|
|
814
|
my $rtname = shift; |
1393
|
|
|
|
|
|
|
|
1394
|
600
|
|
|
|
|
1661
|
my $bug_email = "bug-\L$self->{distro}\E at rt.cpan.org"; |
1395
|
600
|
|
|
|
|
1183
|
my $bug_link = |
1396
|
|
|
|
|
|
|
"https://rt.cpan.org/NoAuth/ReportBug.html?Queue=$self->{distro}"; |
1397
|
|
|
|
|
|
|
|
1398
|
600
|
|
|
|
|
1458
|
my $content = <<"HERE"; |
1399
|
|
|
|
|
|
|
\=head1 BUGS |
1400
|
|
|
|
|
|
|
|
1401
|
|
|
|
|
|
|
Please report any bugs or feature requests to C<$bug_email>, or through |
1402
|
|
|
|
|
|
|
the web interface at L<$bug_link>. I will be notified, and then you'll |
1403
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
1404
|
|
|
|
|
|
|
|
1405
|
|
|
|
|
|
|
HERE |
1406
|
|
|
|
|
|
|
|
1407
|
600
|
|
|
|
|
1308
|
return $content; |
1408
|
|
|
|
|
|
|
} |
1409
|
|
|
|
|
|
|
|
1410
|
|
|
|
|
|
|
sub _module_support { |
1411
|
600
|
|
|
600
|
|
948
|
my $self = shift; |
1412
|
600
|
|
|
|
|
1049
|
my $module = shift; |
1413
|
600
|
|
|
|
|
831
|
my $rtname = shift; |
1414
|
|
|
|
|
|
|
|
1415
|
600
|
|
|
|
|
1226
|
my $content = qq[ |
1416
|
|
|
|
|
|
|
\=head1 SUPPORT |
1417
|
|
|
|
|
|
|
|
1418
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
1419
|
|
|
|
|
|
|
|
1420
|
|
|
|
|
|
|
perldoc $module |
1421
|
|
|
|
|
|
|
]; |
1422
|
600
|
|
|
|
|
1382
|
my @reference_links = _reference_links(); |
1423
|
|
|
|
|
|
|
|
1424
|
600
|
50
|
|
|
|
1762
|
return undef unless @reference_links; |
1425
|
600
|
|
|
|
|
1553
|
$content .= qq[ |
1426
|
|
|
|
|
|
|
|
1427
|
|
|
|
|
|
|
You can also look for information at: |
1428
|
|
|
|
|
|
|
|
1429
|
|
|
|
|
|
|
\=over 4 |
1430
|
|
|
|
|
|
|
]; |
1431
|
|
|
|
|
|
|
|
1432
|
600
|
|
|
|
|
1170
|
foreach my $ref (@reference_links) { |
1433
|
2400
|
|
|
|
|
3126
|
my $title; |
1434
|
2400
|
|
|
|
|
5244
|
my $link = sprintf($ref->{link}, $self->{distro}); |
1435
|
|
|
|
|
|
|
|
1436
|
2400
|
100
|
|
|
|
4946
|
$title = "$ref->{nickname}: " if exists $ref->{nickname}; |
1437
|
2400
|
|
|
|
|
3542
|
$title .= $ref->{title}; |
1438
|
2400
|
|
|
|
|
5984
|
$content .= qq[ |
1439
|
|
|
|
|
|
|
\=item * $title |
1440
|
|
|
|
|
|
|
|
1441
|
|
|
|
|
|
|
L<$link> |
1442
|
|
|
|
|
|
|
]; |
1443
|
|
|
|
|
|
|
} |
1444
|
600
|
|
|
|
|
936
|
$content .= qq[ |
1445
|
|
|
|
|
|
|
\=back |
1446
|
|
|
|
|
|
|
]; |
1447
|
600
|
|
|
|
|
2229
|
return $content; |
1448
|
|
|
|
|
|
|
} |
1449
|
|
|
|
|
|
|
|
1450
|
|
|
|
|
|
|
sub _module_license { |
1451
|
600
|
|
|
600
|
|
952
|
my $self = shift; |
1452
|
|
|
|
|
|
|
|
1453
|
600
|
|
|
|
|
958
|
my $module = shift; |
1454
|
600
|
|
|
|
|
862
|
my $rtname = shift; |
1455
|
|
|
|
|
|
|
|
1456
|
600
|
|
|
|
|
1241
|
my $license_blurb = $self->_license_blurb(); |
1457
|
|
|
|
|
|
|
|
1458
|
600
|
|
|
|
|
1961
|
my $content = qq[ |
1459
|
|
|
|
|
|
|
\=head1 LICENSE AND COPYRIGHT |
1460
|
|
|
|
|
|
|
|
1461
|
|
|
|
|
|
|
$license_blurb |
1462
|
|
|
|
|
|
|
]; |
1463
|
|
|
|
|
|
|
|
1464
|
600
|
|
|
|
|
1452
|
return $content; |
1465
|
|
|
|
|
|
|
} |
1466
|
|
|
|
|
|
|
|
1467
|
|
|
|
|
|
|
sub module_guts { |
1468
|
600
|
|
|
600
|
1
|
995
|
my $self = shift; |
1469
|
600
|
|
|
|
|
971
|
my $module = shift; |
1470
|
600
|
|
|
|
|
927
|
my $rtname = shift; |
1471
|
|
|
|
|
|
|
|
1472
|
|
|
|
|
|
|
# Sub-templates |
1473
|
600
|
|
|
|
|
1447
|
my $header = $self->_module_header($module, $rtname); |
1474
|
600
|
|
|
|
|
1525
|
my $bugs = $self->_module_bugs($module, $rtname); |
1475
|
600
|
|
|
|
|
1327
|
my $support = $self->_module_support($module, $rtname); |
1476
|
600
|
|
|
|
|
1634
|
my $license = $self->_module_license($module, $rtname); |
1477
|
|
|
|
|
|
|
|
1478
|
600
|
|
|
|
|
5986
|
my $content = <<"HERE"; |
1479
|
|
|
|
|
|
|
$header |
1480
|
|
|
|
|
|
|
|
1481
|
|
|
|
|
|
|
\=head1 SYNOPSIS |
1482
|
|
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
Quick summary of what the module does. |
1484
|
|
|
|
|
|
|
|
1485
|
|
|
|
|
|
|
Perhaps a little code snippet. |
1486
|
|
|
|
|
|
|
|
1487
|
|
|
|
|
|
|
use $module; |
1488
|
|
|
|
|
|
|
|
1489
|
|
|
|
|
|
|
my \$foo = $module->new(); |
1490
|
|
|
|
|
|
|
... |
1491
|
|
|
|
|
|
|
|
1492
|
|
|
|
|
|
|
\=head1 EXPORT |
1493
|
|
|
|
|
|
|
|
1494
|
|
|
|
|
|
|
A list of functions that can be exported. You can delete this section |
1495
|
|
|
|
|
|
|
if you don't export anything, such as for a purely object-oriented module. |
1496
|
|
|
|
|
|
|
|
1497
|
|
|
|
|
|
|
\=head1 SUBROUTINES/METHODS |
1498
|
|
|
|
|
|
|
|
1499
|
|
|
|
|
|
|
\=head2 function1 |
1500
|
|
|
|
|
|
|
|
1501
|
|
|
|
|
|
|
\=cut |
1502
|
|
|
|
|
|
|
|
1503
|
|
|
|
|
|
|
sub function1 { |
1504
|
|
|
|
|
|
|
} |
1505
|
|
|
|
|
|
|
|
1506
|
|
|
|
|
|
|
\=head2 function2 |
1507
|
|
|
|
|
|
|
|
1508
|
|
|
|
|
|
|
\=cut |
1509
|
|
|
|
|
|
|
|
1510
|
|
|
|
|
|
|
sub function2 { |
1511
|
|
|
|
|
|
|
} |
1512
|
|
|
|
|
|
|
|
1513
|
|
|
|
|
|
|
\=head1 AUTHOR |
1514
|
|
|
|
|
|
|
|
1515
|
|
|
|
|
|
|
$self->{author}, C<< <$self->{email_obfuscated}> >> |
1516
|
|
|
|
|
|
|
|
1517
|
|
|
|
|
|
|
$bugs |
1518
|
|
|
|
|
|
|
|
1519
|
|
|
|
|
|
|
$support |
1520
|
|
|
|
|
|
|
|
1521
|
|
|
|
|
|
|
\=head1 ACKNOWLEDGEMENTS |
1522
|
|
|
|
|
|
|
|
1523
|
|
|
|
|
|
|
$license |
1524
|
|
|
|
|
|
|
|
1525
|
|
|
|
|
|
|
\=cut |
1526
|
|
|
|
|
|
|
|
1527
|
|
|
|
|
|
|
1; # End of $module |
1528
|
|
|
|
|
|
|
HERE |
1529
|
600
|
|
|
|
|
2575
|
return $content; |
1530
|
|
|
|
|
|
|
} |
1531
|
|
|
|
|
|
|
|
1532
|
|
|
|
|
|
|
1; |
1533
|
|
|
|
|
|
|
|
1534
|
|
|
|
|
|
|
# vi:et:sw=4 ts=4 |