1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
4 .\" ========================================================================
5 .de Sh \" Subsection heading
13 .de Sp \" Vertical space (when we can't use .PP)
17 .de Vb \" Begin verbatim text
22 .de Ve \" End verbatim text
26 .\" Set up some character translations and predefined strings. \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote. | will give a
29 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
37 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
57 . tm Index:\\$1\t\\n%\t"\\$2"
63 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear. Run. Save yourself. No user-serviceable parts.
70 . \" fudge factors for nroff and troff
79 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
85 . \" simple accents for nroff and troff
95 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
102 . \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 . \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 . \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
129 .\" ========================================================================
131 .IX Title "PAR::Dist 3"
132 .TH PAR::Dist 3 "2009-11-29" "perl v5.8.7" "User Contributed Perl Documentation"
134 PAR::Dist \- Create and manipulate PAR distributions
137 This document describes version 0.47 of PAR::Dist, released November 29, 2009.
139 .IX Header "SYNOPSIS"
143 \& % perl \-MPAR::Dist \-eblib_to_par
153 \& my $dist = blib_to_par(); # make a PAR file using ./blib/
154 \& install_par($dist); # install it into the system
155 \& uninstall_par($dist); # uninstall it from the system
156 \& sign_par($dist); # sign it using Module::Signature
157 \& verify_par($dist); # verify it using Module::Signature
161 \& install_par("http://foo.com/DBI\-1.37\-MSWin32\-5.8.0.par"); # works too
162 \& install_par("http://foo.com/DBI\-1.37"); # auto\-appends archname + perlver
163 \& install_par("cpan://SMUELLER/PAR\-Packer\-0.975"); # uses CPAN author directory
166 .IX Header "DESCRIPTION"
167 This module creates and manipulates \fI\s-1PAR\s0 distributions\fR. They are
168 architecture-specific \fB\s-1PAR\s0\fR files, containing everything under \fIblib/\fR
169 of \s-1CPAN\s0 distributions after their \f(CW\*(C`make\*(C'\fR or \f(CW\*(C`Build\*(C'\fR stage, a
170 \&\fI\s-1META\s0.yml\fR describing metadata of the original \s-1CPAN\s0 distribution,
171 and a \fI\s-1MANIFEST\s0\fR detailing all files within it. Digitally signed \s-1PAR\s0
172 distributions will also contain a \fI\s-1SIGNATURE\s0\fR file.
174 The naming convention for such distributions is:
177 \& $NAME\-$VERSION\-$ARCH\-$PERL_VERSION.par
180 For example, \f(CW\*(C`PAR\-Dist\-0.01\-i386\-freebsd\-5.8.0.par\*(C'\fR corresponds to the
181 0.01 release of \f(CW\*(C`PAR\-Dist\*(C'\fR on \s-1CPAN\s0, built for perl 5.8.0 running on
182 \&\f(CW\*(C`i386\-freebsd\*(C'\fR.
184 .IX Header "FUNCTIONS"
185 Several functions are exported by default. Unless otherwise noted,
186 they can take either a hash of
187 named arguments, a single argument (taken as \f(CW$path\fR by \f(CW\*(C`blib_to_par\*(C'\fR
188 and \f(CW$dist\fR by other functions), or no arguments (in which case
189 the first \s-1PAR\s0 file in the current directory is used).
191 Therefore, under a directory containing only a single \fItest.par\fR, all
192 invocations below are equivalent:
195 \& % perl \-MPAR::Dist \-e"install_par( dist => 'test.par' )"
196 \& % perl \-MPAR::Dist \-e"install_par( 'test.par' )"
197 \& % perl \-MPAR::Dist \-einstall_par;
200 If \f(CW$dist\fR resembles a \s-1URL\s0, \f(CW\*(C`LWP::Simple::mirror\*(C'\fR is called to mirror it
201 locally under \f(CW$ENV{PAR_TEMP}\fR (or \f(CW\*(C`$TEMP/par/\*(C'\fR if unspecified), and the
202 function will act on the fetched local file instead. If the \s-1URL\s0 begins
203 with \f(CW\*(C`cpan://AUTHOR/\*(C'\fR, it will be expanded automatically to the author's \s-1CPAN\s0
204 directory (e.g. \f(CW\*(C`http://www.cpan.org/modules/by\-authors/id/A/AU/AUTHOR/\*(C'\fR).
206 If \f(CW$dist\fR does not have a file extension beginning with a letter or
207 underscore, a dash and \f(CW$suffix\fR ($ARCH\-$PERL_VERSION.par by default)
208 will be appended to it.
210 .IX Subsection "blib_to_par"
211 Takes key/value pairs as parameters or a single parameter indicating the
212 path that contains the \fIblib/\fR subdirectory.
214 Builds a \s-1PAR\s0 distribution from the \fIblib/\fR subdirectory under \f(CW\*(C`path\*(C'\fR, or
215 under the current directory if unspecified. If \fIblib/\fR does not exist,
216 it automatically runs \fIBuild\fR, \fImake\fR, \fIBuild.PL\fR or \fIMakefile.PL\fR to
219 Returns the filename of the generated \s-1PAR\s0 distribution.
221 Valid parameters are:
224 Sets the path which contains the \fIblib/\fR subdirectory from which the \s-1PAR\s0
225 distribution will be generated.
226 .IP "name, version, suffix" 2
227 .IX Item "name, version, suffix"
228 These attributes set the name, version and platform specific suffix
229 of the distribution. Name and version can be automatically
230 determined from the distributions \fI\s-1META\s0.yml\fR or \fIMakefile.PL\fR files.
232 The suffix is generated from your architecture name and your version of
236 The output filename for the \s-1PAR\s0 distribution.
239 Set to true to suppress as much output as possible.
241 .IX Subsection "install_par"
242 Installs a \s-1PAR\s0 distribution into the system, using
243 \&\f(CW\*(C`ExtUtils::Install::install_default\*(C'\fR.
245 If only a single parameter is given, it is treated as the value for the
246 \&\f(CW\*(C`dist\*(C'\fR parameter.
248 Valid named parameters are:
251 The .par file to install. The heuristics outlined in the \fB\s-1FUNCTIONS\s0\fR
255 This string will be prepended to all installation paths.
256 If it isn't specified, the environment variable
257 \&\f(CW\*(C`PERL_INSTALL_ROOT\*(C'\fR is used as a prefix.
258 .IP "uninstall_shadows" 2
259 .IX Item "uninstall_shadows"
260 This corresponds to the \f(CW\*(C`uninstall_shadows\*(C'\fR option of ExtUtils::Install. Quoting its manual:
261 If \f(CW\*(C`uninstall_shadows\*(C'\fR is set to true, any differing versions throughout \f(CW@INC\fR
262 will be uninstalled. This is \f(CW\*(C`make install UNINST=1\*(C'\fR.
265 This corresponds to the \f(CW\*(C`verbose\*(C'\fR option of ExtUtils::Install. According to its manual:
266 If \f(CW\*(C`verbose\*(C'\fR is true, will print out each file removed. This is \f(CW\*(C`make install VERBINST=1\*(C'\fR.
267 \&\f(CW\*(C`verbose\*(C'\fR values going up to 5 show increasingly more diagnostics output.
269 Default verbosity for PAR::Dist is 1.
271 If you're just going to install into the running perl like everything else,
272 you can stop reading the rest of this section now.
274 Additionally, you can use several parameters to change the default
275 installation destinations. You don't usually have to worry about this
276 unless you are installing into a user-local directory.
277 The following section outlines the parameter names and default settings:
281 \& inst_lib blib/lib $Config{installsitelib} (*)
282 \& inst_archlib blib/arch $Config{installsitearch}
283 \& inst_script blib/script $Config{installscript}
284 \& inst_bin blib/bin $Config{installbin}
285 \& inst_man1dir blib/man1 $Config{installman1dir}
286 \& inst_man3dir blib/man3 $Config{installman3dir}
287 \& packlist_read $Config{sitearchexp}/auto/$name/.packlist
288 \& packlist_write $Config{installsitearch}/auto/$name/.packlist
291 The \f(CW\*(C`packlist_write\*(C'\fR parameter is used to control where the \fI.packlist\fR
292 file is written to. (Necessary for uninstallation.)
293 The \f(CW\*(C`packlist_read\*(C'\fR parameter specifies a .packlist file to merge in if
294 it exists. By setting any of the above installation targets to \f(CW\*(C`undef\*(C'\fR,
295 you can remove that target altogether. For example, passing
296 \&\f(CW\*(C`inst_man1dir => undef, inst_man3dir => undef\*(C'\fR means that the contained
297 manual pages won't be installed. This is not available for the packlists.
299 Again, the defaults will be the normal \fIsite\fR paths from \f(CW%Config\fR.
301 (*) If the \f(CW\*(C`.par\*(C'\fR's \fIinst_archlib\fR section (normally \f(CW\*(C`blib/arch\*(C'\fR)
302 isn't empty, the code in \fIinst_lib\fR (normally \f(CW\*(C`blib/lib\*(C'\fR) is also installed
303 into the \fIinst_archlib\fR path. This makes sense for \s-1XS\s0 modules.
304 If, however, you override \f(CW\*(C`inst_lib\*(C'\fR, this automatic conversion is
305 also overridden! You can use the named parameter
306 \&\f(CW\*(C`auto_inst_lib_conversion => 1\*(C'\fR to re-enable the conversion
307 for custom \fIinst_lib\fR's.
309 Finally, you may specify a \f(CW\*(C`custom_targets\*(C'\fR parameter. Its value should be
310 a reference to a hash of custom installation targets such as
313 \& custom_targets => { 'blib/my_data' => '/some/path/my_data' }
316 You can use this to install the \fI.par\fR archives contents to arbitrary
319 .IX Subsection "uninstall_par"
320 Uninstalls all previously installed contents of a \s-1PAR\s0 distribution,
321 using \f(CW\*(C`ExtUtils::Install::uninstall\*(C'\fR.
323 Takes almost the same parameters as \f(CW\*(C`install_par\*(C'\fR, but naturally,
324 the installation target parameters do not apply. The only exception
325 to this is the \f(CW\*(C`packlist_read\*(C'\fR parameter which specifies the
326 \&\fI.packlist\fR file to read the list of installed files from.
327 It defaults to \f(CW\*(C`$Config::Config{installsitearch}/auto/$name/.packlist\*(C'\fR.
329 Additionally, the \f(CW\*(C`uninstall_shadows\*(C'\fR parameter of \f(CW\*(C`install_par\*(C'\fR
332 .IX Subsection "sign_par"
333 Digitally sign a \s-1PAR\s0 distribution using \f(CW\*(C`gpg\*(C'\fR or \fBCrypt::OpenPGP\fR,
334 via \fBModule::Signature\fR.
336 .IX Subsection "verify_par"
337 Verify the digital signature of a \s-1PAR\s0 distribution using \f(CW\*(C`gpg\*(C'\fR or
338 \&\fBCrypt::OpenPGP\fR, via \fBModule::Signature\fR.
340 Returns a boolean value indicating whether verification passed; \f(CW$!\fR
341 is set to the return code of \f(CW\*(C`Module::Signature::verify\*(C'\fR.
343 .IX Subsection "merge_par"
344 \&\fINote:\fR Since version 0.32 of PAR::Dist, this function requires a \s-1YAML\s0
345 reader. The order of precedence is:
348 \& YAML YAML::Syck YAML::Tiny YAML::XS
351 Merges two or more \s-1PAR\s0 distributions into one. First argument must
352 be the name of the distribution you want to merge all others into.
353 Any following arguments will be interpreted as the file names of
354 further \s-1PAR\s0 distributions to merge into the first one.
357 \& merge_par('foo.par', 'bar.par', 'baz.par')
360 This will merge the distributions \f(CW\*(C`foo.par\*(C'\fR, \f(CW\*(C`bar.par\*(C'\fR and \f(CW\*(C`baz.par\*(C'\fR
361 into the distribution \f(CW\*(C`foo.par\*(C'\fR. \f(CW\*(C`foo.par\*(C'\fR will be overwritten!
363 The original \s-1META\s0.yml of \f(CW\*(C`foo.par\*(C'\fR is retained, but augmented with any
364 \&\f(CW\*(C`provides\*(C'\fR, \f(CW\*(C`requires\*(C'\fR, \f(CW\*(C`recommends\*(C'\fR, \f(CW\*(C`build_requires\*(C'\fR, and
365 \&\f(CW\*(C`configure_requires\*(C'\fR sections from the other \f(CW\*(C`.par\*(C'\fR files.
367 .IX Subsection "remove_man"
368 Remove the man pages from a \s-1PAR\s0 distribution. Takes one named
369 parameter: \fIdist\fR which should be the name (and path) of the
370 \&\s-1PAR\s0 distribution file. The calling conventions outlined in
371 the \f(CW\*(C`FUNCTIONS\*(C'\fR section above apply.
373 The \s-1PAR\s0 archive will be
374 extracted, stripped of all \f(CW\*(C`man\ed?\*(C'\fR and \f(CW\*(C`html\*(C'\fR subdirectories
375 and then repackaged into the original file.
377 .IX Subsection "get_meta"
378 Opens a \s-1PAR\s0 archive and extracts the contained \s-1META\s0.yml file.
379 Returns the \s-1META\s0.yml file as a string.
381 Takes one named parameter: \fIdist\fR. If only one parameter is
382 passed, it is treated as the \fIdist\fR parameter. (Have a look
383 at the description in the \f(CW\*(C`FUNCTIONS\*(C'\fR section above.)
385 Returns undef if no \s-1PAR\s0 archive or no \s-1META\s0.yml within the
387 .Sh "parse_dist_name"
388 .IX Subsection "parse_dist_name"
389 First argument must be a distribution file name. The file name
390 is parsed into \fIdistribution name\fR, \fIdistribution version\fR,
391 \&\fIarchitecture name\fR, and \fIperl version\fR.
393 Returns the results as a list in the above order.
394 If any or all of the above cannot be determined, returns undef instead
395 of the undetermined elements.
397 Supported formats are:
399 Math\-Symbolic\-0.502\-x86_64\-linux\-gnu\-thread\-multi\-5.8.7
401 Math\-Symbolic\-0.502
403 The \*(L".tar.gz\*(R" or \*(L".par\*(R" extensions as well as any
404 preceding paths are stripped before parsing. Starting with \f(CW\*(C`PAR::Dist\*(C'\fR
405 0.22, versions containing a preceding \f(CW\*(C`v\*(C'\fR are parsed correctly.
407 This function is not exported by default.
408 .Sh "generate_blib_stub"
409 .IX Subsection "generate_blib_stub"
410 Creates a \fIblib/lib\fR subdirectory in the current directory
411 and prepares a \fI\s-1META\s0.yml\fR with meta information for a
412 new \s-1PAR\s0 distribution. First argument should be the name of the
413 \&\s-1PAR\s0 distribution in a format understood by \f(CW\*(C`parse_dist_name()\*(C'\fR.
414 Alternatively, named arguments resembling those of
415 \&\f(CW\*(C`blib_to_par\*(C'\fR are accepted.
417 After running \f(CW\*(C`generate_blib_stub\*(C'\fR and injecting files into
418 the \fIblib\fR directory, you can create a \s-1PAR\s0 distribution
419 using \f(CW\*(C`blib_to_par\*(C'\fR.
420 This function is useful for creating custom \s-1PAR\s0 distributions
421 from scratch. (I.e. not from an unpacked \s-1CPAN\s0 distribution)
426 \& use File::Copy 'copy';
430 \& generate_blib_stub(
431 \& name => 'MyApp', version => '1.00'
433 \& copy('MyApp.pm', 'blib/lib/MyApp.pm');
434 \& blib_to_par(); # generates the .par file!
437 \&\f(CW\*(C`generate_blib_stub\*(C'\fR will not overwrite existing files.
438 .Sh "contains_binaries"
439 .IX Subsection "contains_binaries"
440 This function is not exported by default.
442 Opens a \s-1PAR\s0 archive tries to determine whether that archive
443 contains platform-specific binary code.
445 Takes one named parameter: \fIdist\fR. If only one parameter is
446 passed, it is treated as the \fIdist\fR parameter. (Have a look
447 at the description in the \f(CW\*(C`FUNCTIONS\*(C'\fR section above.)
449 Throws a fatal error if the \s-1PAR\s0 archive could not be found.
451 Returns one if the \s-1PAR\s0 was found to contain binary code
454 .IX Header "SEE ALSO"
455 \&\s-1PAR\s0, ExtUtils::Install, Module::Signature, LWP::Simple
458 Audrey Tang <cpan@audreyt.org> 2003\-2007
460 Steffen Mueller <smueller@cpan.org> 2005\-2009
462 \&\s-1PAR\s0 has a mailing list, <par@perl.org>, that you can write to;
463 send an empty mail to <par\-subscribe@perl.org> to join the list
464 and participate in the discussion.
466 Please send bug reports to <bug\-par@rt.cpan.org>.
468 .IX Header "COPYRIGHT"
469 Copyright 2003\-2009 by Audrey Tang <autrijus@autrijus.org>.
471 This program is free software; you can redistribute it and/or modify it
472 under the same terms as Perl itself.
474 See <http://www.perl.com/perl/misc/Artistic.html>