1ExtUtils::Install(3) User Contributed Perl Documentation ExtUtils::Install(3)
2
3
4
6 ExtUtils::Install - install files from here to there
7
9 use ExtUtils::Install;
10
11 install({ 'blib/lib' => 'some/install/dir' } );
12
13 uninstall($packlist);
14
15 pm_to_blib({ 'lib/Foo/Bar.pm' => 'blib/lib/Foo/Bar.pm' });
16
18 2.14
19
21 Handles the installing and uninstalling of perl modules, scripts, man
22 pages, etc...
23
24 Both install() and uninstall() are specific to the way
25 ExtUtils::MakeMaker handles the installation and deinstallation of perl
26 modules. They are not designed as general purpose tools.
27
28 On some operating systems such as Win32 installation may not be
29 possible until after a reboot has occurred. This can have varying
30 consequences: removing an old DLL does not impact programs using the
31 new one, but if a new DLL cannot be installed properly until reboot
32 then anything depending on it must wait. The package variable
33
34 $ExtUtils::Install::MUST_REBOOT
35
36 is used to store this status.
37
38 If this variable is true then such an operation has occurred and
39 anything depending on this module cannot proceed until a reboot has
40 occurred.
41
42 If this value is defined but false then such an operation has ocurred,
43 but should not impact later operations.
44
45 Functions
46 install
47 # deprecated forms
48 install(\%from_to);
49 install(\%from_to, $verbose, $dry_run, $uninstall_shadows,
50 $skip, $always_copy, \%result);
51
52 # recommended form as of 1.47
53 install([
54 from_to => \%from_to,
55 verbose => 1,
56 dry_run => 0,
57 uninstall_shadows => 1,
58 skip => undef,
59 always_copy => 1,
60 result => \%install_results,
61 ]);
62
63 Copies each directory tree of %from_to to its corresponding value
64 preserving timestamps and permissions.
65
66 There are two keys with a special meaning in the hash: "read" and
67 "write". These contain packlist files. After the copying is done,
68 install() will write the list of target files to $from_to{write}.
69 If $from_to{read} is given the contents of this file will be merged
70 into the written file. The read and the written file may be
71 identical, but on AFS it is quite likely that people are installing
72 to a different directory than the one where the files later appear.
73
74 If $verbose is true, will print out each file removed. Default is
75 false. This is "make install VERBINST=1". $verbose values going up
76 to 5 show increasingly more diagnostics output.
77
78 If $dry_run is true it will only print what it was going to do
79 without actually doing it. Default is false.
80
81 If $uninstall_shadows is true any differing versions throughout
82 @INC will be uninstalled. This is "make install UNINST=1"
83
84 As of 1.37_02 install() supports the use of a list of patterns to
85 filter out files that shouldn't be installed. If $skip is omitted
86 or undefined then install will try to read the list from
87 INSTALL.SKIP in the CWD. This file is a list of regular expressions
88 and is just like the MANIFEST.SKIP file used by ExtUtils::Manifest.
89
90 A default site INSTALL.SKIP may be provided by setting then
91 environment variable EU_INSTALL_SITE_SKIPFILE, this will only be
92 used when there isn't a distribution specific INSTALL.SKIP. If the
93 environment variable EU_INSTALL_IGNORE_SKIP is true then no install
94 file filtering will be performed.
95
96 If $skip is undefined then the skip file will be autodetected and
97 used if it is found. If $skip is a reference to an array then it is
98 assumed the array contains the list of patterns, if $skip is a true
99 non reference it is assumed to be the filename holding the list of
100 patterns, any other value of $skip is taken to mean that no install
101 filtering should occur.
102
103 Changes As of Version 1.47
104
105 As of version 1.47 the following additions were made to the install
106 interface. Note that the new argument style and use of the %result
107 hash is recommended.
108
109 The $always_copy parameter which when true causes files to be
110 updated regardless as to whether they have changed, if it is
111 defined but false then copies are made only if the files have
112 changed, if it is undefined then the value of the environment
113 variable EU_INSTALL_ALWAYS_COPY is used as default.
114
115 The %result hash will be populated with the various keys/subhashes
116 reflecting the install. Currently these keys and their structure
117 are:
118
119 install => { $target => $source },
120 install_fail => { $target => $source },
121 install_unchanged => { $target => $source },
122
123 install_filtered => { $source => $pattern },
124
125 uninstall => { $uninstalled => $source },
126 uninstall_fail => { $uninstalled => $source },
127
128 where $source is the filespec of the file being installed. $target
129 is where it is being installed to, and $uninstalled is any shadow
130 file that is in @INC or $ENV{PERL5LIB} or other standard locations,
131 and $pattern is the pattern that caused a source file to be
132 skipped. In future more keys will be added, such as to show created
133 directories, however this requires changes in other modules and
134 must therefore wait.
135
136 These keys will be populated before any exceptions are thrown
137 should there be an error.
138
139 Note that all updates of the %result are additive, the hash will
140 not be cleared before use, thus allowing status results of many
141 installs to be easily aggregated.
142
143 NEW ARGUMENT STYLE
144
145 If there is only one argument and it is a reference to an array
146 then the array is assumed to contain a list of key-value pairs
147 specifying the options. In this case the option "from_to" is
148 mandatory. This style means that you do not have to supply a
149 cryptic list of arguments and can use a self documenting argument
150 list that is easier to understand.
151
152 This is now the recommended interface to install().
153
154 RETURN
155
156 If all actions were successful install will return a hashref of the
157 results as described above for the $result parameter. If any action
158 is a failure then install will die, therefore it is recommended to
159 pass in the $result parameter instead of using the return value. If
160 the result parameter is provided then the returned hashref will be
161 the passed in hashref.
162
163 install_default DISCOURAGED
164 install_default();
165 install_default($fullext);
166
167 Calls install() with arguments to copy a module from blib/ to the
168 default site installation location.
169
170 $fullext is the name of the module converted to a directory (ie.
171 Foo::Bar would be Foo/Bar). If $fullext is not specified, it will
172 attempt to read it from @ARGV.
173
174 This is primarily useful for install scripts.
175
176 NOTE This function is not really useful because of the hard-coded
177 install location with no way to control site vs core vs vendor
178 directories and the strange way in which the module name is given.
179 Consider its use discouraged.
180
181 uninstall
182 uninstall($packlist_file);
183 uninstall($packlist_file, $verbose, $dont_execute);
184
185 Removes the files listed in a $packlist_file.
186
187 If $verbose is true, will print out each file removed. Default is
188 false.
189
190 If $dont_execute is true it will only print what it was going to do
191 without actually doing it. Default is false.
192
193 pm_to_blib
194 pm_to_blib(\%from_to);
195 pm_to_blib(\%from_to, $autosplit_dir);
196 pm_to_blib(\%from_to, $autosplit_dir, $filter_cmd);
197
198 Copies each key of %from_to to its corresponding value efficiently.
199 If an $autosplit_dir is provided, all .pm files will be autosplit
200 into it. Any destination directories are created.
201
202 $filter_cmd is an optional shell command to run each .pm file
203 through prior to splitting and copying. Input is the contents of
204 the module, output the new module contents.
205
206 You can have an environment variable PERL_INSTALL_ROOT set which
207 will be prepended as a directory to each installed file (and
208 directory).
209
210 By default verbose output is generated, setting the
211 PERL_INSTALL_QUIET environment variable will silence this output.
212
214 PERL_INSTALL_ROOT
215 Will be prepended to each install path.
216
217 EU_INSTALL_IGNORE_SKIP
218 Will prevent the automatic use of INSTALL.SKIP as the install skip
219 file.
220
221 EU_INSTALL_SITE_SKIPFILE
222 If there is no INSTALL.SKIP file in the make directory then this
223 value can be used to provide a default.
224
225 EU_INSTALL_ALWAYS_COPY
226 If this environment variable is true then normal install processes
227 will always overwrite older identical files during the install
228 process.
229
230 Note that the alias EU_ALWAYS_COPY will be supported if
231 EU_INSTALL_ALWAYS_COPY is not defined until at least the 1.50
232 release. Please ensure you use the correct EU_INSTALL_ALWAYS_COPY.
233
235 Original author lost in the mists of time. Probably the same as
236 Makemaker.
237
238 Production release currently maintained by demerphq "yves at cpan.org",
239 extensive changes by Michael G. Schwern.
240
241 Send bug reports via http://rt.cpan.org/. Please send your generated
242 Makefile along with your report.
243
245 This program is free software; you can redistribute it and/or modify it
246 under the same terms as Perl itself.
247
248 See <http://www.perl.com/perl/misc/Artistic.html>
249
250
251
252perl v5.28.1 2017-05-28 ExtUtils::Install(3)