line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Maker; |
2
|
1
|
|
|
1
|
|
670
|
use 5.008003; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
756
|
use Mouse; |
|
1
|
|
|
|
|
39212
|
|
|
1
|
|
|
|
|
4
|
|
5
|
1
|
|
|
1
|
|
1025
|
use YAML::XS; |
|
1
|
|
|
|
|
2816
|
|
|
1
|
|
|
|
|
58
|
|
6
|
1
|
|
|
1
|
|
897
|
use File::ShareDir; |
|
1
|
|
|
|
|
6809
|
|
|
1
|
|
|
|
|
53
|
|
7
|
1
|
|
|
1
|
|
1280
|
use Getopt::Long; |
|
1
|
|
|
|
|
12001
|
|
|
1
|
|
|
|
|
9
|
|
8
|
1
|
|
|
1
|
|
1667
|
use IPC::Run; |
|
1
|
|
|
|
|
54291
|
|
|
1
|
|
|
|
|
446
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$Perl::Maker::VERSION = '0.01'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has action => (is => 'ro'); |
13
|
|
|
|
|
|
|
has args => (is => 'ro', default => sub {[]}); |
14
|
|
|
|
|
|
|
has file => (is => 'ro'); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
around BUILDARGS => sub { |
17
|
|
|
|
|
|
|
my ($orig, $class, $script, @args) = @_; |
18
|
|
|
|
|
|
|
my $hash = {}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
while (1) { |
21
|
|
|
|
|
|
|
if (not @args) { |
22
|
|
|
|
|
|
|
$hash->{action} = 'help'; |
23
|
|
|
|
|
|
|
last; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
if ($args[0] !~ /^-/) { |
26
|
|
|
|
|
|
|
$hash->{action} = shift(@args); |
27
|
|
|
|
|
|
|
last; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
local @ARGV = @args; |
30
|
|
|
|
|
|
|
GetOptions( |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
@args = @ARGV; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
$hash->{file} = shift(@args) || ''; |
36
|
|
|
|
|
|
|
die "Extra arguments '@args'\n" if @args; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$class->$orig($hash); |
39
|
|
|
|
|
|
|
}; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub run { |
42
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
43
|
0
|
|
|
|
|
|
my $action = $self->action; |
44
|
0
|
|
|
|
|
|
my $method = "handle_$action"; |
45
|
0
|
0
|
|
|
|
|
die "'action' command not supported\n" |
46
|
|
|
|
|
|
|
unless $self->can($method); |
47
|
0
|
|
|
|
|
|
$self->$method(@{$self->args}); |
|
0
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub handle_new { |
51
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub handle_make { |
55
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub write_makefile { |
59
|
0
|
|
|
0
|
0
|
|
die "Perl::Maker does not work!\n"; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=enccoding utf8 |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 NAME |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Perl::Maker - Make a Custom Perl with Modules |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SYNOPSIS |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
> perl-maker --make ingy-perl-maker.yaml |
73
|
|
|
|
|
|
|
> make install |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
> make perlbrew |
76
|
|
|
|
|
|
|
> make debian |
77
|
|
|
|
|
|
|
> make dmg |
78
|
|
|
|
|
|
|
> make rpm |
79
|
|
|
|
|
|
|
> make msi |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 STATUS |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This software is pre-alpha quality. Don't use it yet. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 DESCRIPTION |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Perl::Maker creates a custom Perl installation, complete with an |
88
|
|
|
|
|
|
|
entire set of modules, based on a simple YAML specification. You can |
89
|
|
|
|
|
|
|
share the installation as a system package (like Debian for instance). |
90
|
|
|
|
|
|
|
You can also share the YAML specification, or use an existing one from |
91
|
|
|
|
|
|
|
somebody else. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
The point of Perl::Maker is to make usable Perl installations that are |
94
|
|
|
|
|
|
|
shareable. In many situations (especially in production environments), |
95
|
|
|
|
|
|
|
it is critical not just to require that Perl and some modules to be |
96
|
|
|
|
|
|
|
installed, but specific versions of things that are configured a |
97
|
|
|
|
|
|
|
specific way. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
With Perl::Maker, you specify all your requirements in a clean and |
100
|
|
|
|
|
|
|
simple YAML file. Perl::Maker will turn this into a Makefile. Then you |
101
|
|
|
|
|
|
|
simply invoke C to do all the necessary work. Since the Makefile |
102
|
|
|
|
|
|
|
targets know all their dependencies, when you make small changes to the |
103
|
|
|
|
|
|
|
YAML file, only the minimum work to accomplish your goals will be |
104
|
|
|
|
|
|
|
performed. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 USAGE |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Perl::Maker installs a command line tool called C. This |
109
|
|
|
|
|
|
|
section explains the commands you can use. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=over |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=item perl-maker --new filename.yaml |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This will create a sample Perl::Maker YAML specification for you. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item perl-maker --make filename.yaml |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This will generate a C from the YAML specification. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=back |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 TARGETS |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
This section describes the targets that you can use in the C, |
126
|
|
|
|
|
|
|
to do various tasks. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=over |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item make install |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
This will build everything and install it for you. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=item make debian |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
This will make a Debian package that you can share and install on Debian |
137
|
|
|
|
|
|
|
based systems. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item make dmg |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
This will make a Mac OS X distribution. |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item make perlbrew |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Build and install in your perlbrew location. |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=back |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 AUTHOR |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Ingy döt Net |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head1 COPYRIGHT |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
Copyright (c) 2011. Ingy döt Net. |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
158
|
|
|
|
|
|
|
under the same terms as Perl itself. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
See http://www.perl.com/perl/misc/Artistic.html |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=cut |