.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PAR::Dist 3" .TH PAR::Dist 3 2024-09-01 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME PAR::Dist \- Create and manipulate PAR distributions .SH SYNOPSIS .IX Header "SYNOPSIS" As a shell command: .PP .Vb 1 \& % perl \-MPAR::Dist \-eblib_to_par .Ve .PP In programs: .PP .Vb 1 \& use PAR::Dist; \& \& my $dist = blib_to_par(); # make a PAR file using ./blib/ \& install_par($dist); # install it into the system \& uninstall_par($dist); # uninstall it from the system \& sign_par($dist); # sign it using Module::Signature \& verify_par($dist); # verify it using Module::Signature \& \& install_par("http://foo.com/DBI\-1.37\-MSWin32\-5.8.0.par"); # works too \& install_par("http://foo.com/DBI\-1.37"); # auto\-appends archname + perlver \& install_par("cpan://SMUELLER/PAR\-Packer\-0.975"); # uses CPAN author directory .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module creates and manipulates \fIPAR distributions\fR. They are architecture-specific \fBPAR\fR files, containing everything under \fIblib/\fR of CPAN distributions after their \f(CW\*(C`make\*(C'\fR or \f(CW\*(C`Build\*(C'\fR stage, a \&\fIMETA.yml\fR describing metadata of the original CPAN distribution, and a \fIMANIFEST\fR detailing all files within it. Digitally signed PAR distributions will also contain a \fISIGNATURE\fR file. .PP The naming convention for such distributions is: .PP .Vb 1 \& $NAME\-$VERSION\-$ARCH\-$PERL_VERSION.par .Ve .PP For example, \f(CW\*(C`PAR\-Dist\-0.01\-i386\-freebsd\-5.8.0.par\*(C'\fR corresponds to the 0.01 release of \f(CW\*(C`PAR\-Dist\*(C'\fR on CPAN, built for perl 5.8.0 running on \&\f(CW\*(C`i386\-freebsd\*(C'\fR. .SH FUNCTIONS .IX Header "FUNCTIONS" Several functions are exported by default. Unless otherwise noted, they can take either a hash of named arguments, a single argument (taken as \f(CW$path\fR by \f(CW\*(C`blib_to_par\*(C'\fR and \f(CW$dist\fR by other functions), or no arguments (in which case the first PAR file in the current directory is used). .PP Therefore, under a directory containing only a single \fItest.par\fR, all invocations below are equivalent: .PP .Vb 3 \& % perl \-MPAR::Dist \-e"install_par( dist => \*(Aqtest.par\*(Aq )" \& % perl \-MPAR::Dist \-e"install_par( \*(Aqtest.par\*(Aq )" \& % perl \-MPAR::Dist \-einstall_par; .Ve .PP If \f(CW$dist\fR resembles a URL, \f(CW\*(C`LWP::Simple::mirror\*(C'\fR is called to mirror it locally under \f(CW$ENV{PAR_TEMP}\fR (or \f(CW\*(C`$TEMP/par/\*(C'\fR if unspecified), and the function will act on the fetched local file instead. If the URL begins with \f(CW\*(C`cpan://AUTHOR/\*(C'\fR, it will be expanded automatically to the author's CPAN directory (e.g. \f(CW\*(C`http://www.cpan.org/modules/by\-authors/id/A/AU/AUTHOR/\*(C'\fR). .PP If \f(CW$dist\fR does not have a file extension beginning with a letter or underscore, a dash and \f(CW$suffix\fR ($ARCH\-$PERL_VERSION.par by default) will be appended to it. .SS blib_to_par .IX Subsection "blib_to_par" Takes key/value pairs as parameters or a single parameter indicating the path that contains the \fIblib/\fR subdirectory. .PP Builds a PAR distribution from the \fIblib/\fR subdirectory under \f(CW\*(C`path\*(C'\fR, or under the current directory if unspecified. If \fIblib/\fR does not exist, it automatically runs \fIBuild\fR, \fImake\fR, \fIBuild.PL\fR or \fIMakefile.PL\fR to create it. .PP Returns the filename of the generated PAR distribution. .PP Valid parameters are: .IP path 2 .IX Item "path" Sets the path which contains the \fIblib/\fR subdirectory from which the PAR distribution will be generated. .IP "name, version, suffix" 2 .IX Item "name, version, suffix" These attributes set the name, version and platform specific suffix of the distribution. Name and version can be automatically determined from the distributions \fIMETA.yml\fR or \fIMakefile.PL\fR files. .Sp The suffix is generated from your architecture name and your version of perl by default. .IP dist 2 .IX Item "dist" The output filename for the PAR distribution. .IP quiet 2 .IX Item "quiet" Set to true to suppress as much output as possible. .SS install_par .IX Subsection "install_par" Installs a PAR distribution into the system, using \&\f(CW\*(C`ExtUtils::Install::install_default\*(C'\fR. .PP If only a single parameter is given, it is treated as the value for the \&\f(CW\*(C`dist\*(C'\fR parameter. .PP Valid named parameters are: .IP dist 2 .IX Item "dist" The .par file to install. The heuristics outlined in the \fBFUNCTIONS\fR section above apply. .IP prefix 2 .IX Item "prefix" This string will be prepended to all installation paths. If it isn't specified, the environment variable \&\f(CW\*(C`PERL_INSTALL_ROOT\*(C'\fR is used as a prefix. .IP uninstall_shadows 2 .IX Item "uninstall_shadows" This corresponds to the \f(CW\*(C`uninstall_shadows\*(C'\fR option of ExtUtils::Install. Quoting its manual: If \f(CW\*(C`uninstall_shadows\*(C'\fR is set to true, any differing versions throughout \f(CW@INC\fR will be uninstalled. This is \f(CW\*(C`make install UNINST=1\*(C'\fR. .IP verbose 2 .IX Item "verbose" This corresponds to the \f(CW\*(C`verbose\*(C'\fR option of ExtUtils::Install. According to its manual: 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. \&\f(CW\*(C`verbose\*(C'\fR values going up to 5 show increasingly more diagnostics output. .Sp Default verbosity for PAR::Dist is 1. .PP If you're just going to install into the running perl like everything else, you can stop reading the rest of this section now. .PP Additionally, you can use several parameters to change the default installation destinations. You don't usually have to worry about this unless you are installing into a user-local directory. The following section outlines the parameter names and default settings: .PP .Vb 9 \& Parameter From To \& inst_lib blib/lib $Config{installsitelib} (*) \& inst_archlib blib/arch $Config{installsitearch} \& inst_script blib/script $Config{installscript} \& inst_bin blib/bin $Config{installbin} \& inst_man1dir blib/man1 $Config{installman1dir} \& inst_man3dir blib/man3 $Config{installman3dir} \& packlist_read $Config{sitearchexp}/auto/$name/.packlist \& packlist_write $Config{installsitearch}/auto/$name/.packlist .Ve .PP The \f(CW\*(C`packlist_write\*(C'\fR parameter is used to control where the \fI.packlist\fR file is written to. (Necessary for uninstallation.) The \f(CW\*(C`packlist_read\*(C'\fR parameter specifies a .packlist file to merge in if it exists. By setting any of the above installation targets to \f(CW\*(C`undef\*(C'\fR, you can remove that target altogether. For example, passing \&\f(CW\*(C`inst_man1dir => undef, inst_man3dir => undef\*(C'\fR means that the contained manual pages won't be installed. This is not available for the packlists. .PP Again, the defaults will be the normal \fIsite\fR paths from \f(CW%Config\fR. .PP (*) If the \f(CW\*(C`.par\*(C'\fR's \fIinst_archlib\fR section (normally \f(CW\*(C`blib/arch\*(C'\fR) isn't empty, the code in \fIinst_lib\fR (normally \f(CW\*(C`blib/lib\*(C'\fR) is also installed into the \fIinst_archlib\fR path. This makes sense for XS modules. If, however, you override \f(CW\*(C`inst_lib\*(C'\fR, this automatic conversion is also overridden! You can use the named parameter \&\f(CW\*(C`auto_inst_lib_conversion => 1\*(C'\fR to re-enable the conversion for custom \fIinst_lib\fR's. .PP Finally, you may specify a \f(CW\*(C`custom_targets\*(C'\fR parameter. Its value should be a reference to a hash of custom installation targets such as .PP .Vb 1 \& custom_targets => { \*(Aqblib/my_data\*(Aq => \*(Aq/some/path/my_data\*(Aq } .Ve .PP You can use this to install the \fI.par\fR archives contents to arbitrary locations. .SS uninstall_par .IX Subsection "uninstall_par" Uninstalls all previously installed contents of a PAR distribution, using \f(CW\*(C`ExtUtils::Install::uninstall\*(C'\fR. .PP Takes almost the same parameters as \f(CW\*(C`install_par\*(C'\fR, but naturally, the installation target parameters do not apply. The only exception to this is the \f(CW\*(C`packlist_read\*(C'\fR parameter which specifies the \&\fI.packlist\fR file to read the list of installed files from. It defaults to \f(CW\*(C`$Config::Config{installsitearch}/auto/$name/.packlist\*(C'\fR. .PP Additionally, the \f(CW\*(C`uninstall_shadows\*(C'\fR parameter of \f(CW\*(C`install_par\*(C'\fR isn't available. .SS sign_par .IX Subsection "sign_par" Digitally sign a PAR distribution using \f(CW\*(C`gpg\*(C'\fR or \fBCrypt::OpenPGP\fR, via \fBModule::Signature\fR. .SS verify_par .IX Subsection "verify_par" Verify the digital signature of a PAR distribution using \f(CW\*(C`gpg\*(C'\fR or \&\fBCrypt::OpenPGP\fR, via \fBModule::Signature\fR. .PP Returns a boolean value indicating whether verification passed; \f(CW$!\fR is set to the return code of \f(CW\*(C`Module::Signature::verify\*(C'\fR. .SS merge_par .IX Subsection "merge_par" \&\fINote:\fR Since version 0.32 of PAR::Dist, this function requires a YAML reader. The order of precedence is: .PP .Vb 1 \& YAML:XS YAML YAML::Syck YAML::Tiny .Ve .PP Merges two or more PAR distributions into one. First argument must be the name of the distribution you want to merge all others into. Any following arguments will be interpreted as the file names of further PAR distributions to merge into the first one. .PP .Vb 1 \& merge_par(\*(Aqfoo.par\*(Aq, \*(Aqbar.par\*(Aq, \*(Aqbaz.par\*(Aq) .Ve .PP 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 into the distribution \f(CW\*(C`foo.par\*(C'\fR. \f(CW\*(C`foo.par\*(C'\fR will be overwritten! .PP The original META.yml of \f(CW\*(C`foo.par\*(C'\fR is retained, but augmented with any \&\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 \&\f(CW\*(C`configure_requires\*(C'\fR sections from the other \f(CW\*(C`.par\*(C'\fR files. .SS remove_man .IX Subsection "remove_man" Remove the man pages from a PAR distribution. Takes one named parameter: \fIdist\fR which should be the name (and path) of the PAR distribution file. The calling conventions outlined in the \f(CW\*(C`FUNCTIONS\*(C'\fR section above apply. .PP The PAR archive will be extracted, stripped of all \f(CW\*(C`man\ed?\*(C'\fR and \f(CW\*(C`html\*(C'\fR subdirectories and then repackaged into the original file. .SS get_meta .IX Subsection "get_meta" Opens a PAR archive and extracts the contained META.yml file. Returns the META.yml file as a string. .PP Takes one named parameter: \fIdist\fR. If only one parameter is passed, it is treated as the \fIdist\fR parameter. (Have a look at the description in the \f(CW\*(C`FUNCTIONS\*(C'\fR section above.) .PP Returns undef if no PAR archive or no META.yml within the archive were found. .SS parse_dist_name .IX Subsection "parse_dist_name" First argument must be a distribution file name. The file name is parsed into \fIdistribution name\fR, \fIdistribution version\fR, \&\fIarchitecture name\fR, and \fIperl version\fR. .PP Returns the results as a list in the above order. If any or all of the above cannot be determined, returns undef instead of the undetermined elements. .PP Supported formats are: .PP Math\-Symbolic\-0.502\-x86_64\-linux\-gnu\-thread\-multi\-5.8.7 .PP Math\-Symbolic\-0.502 .PP The ".tar.gz" or ".par" extensions as well as any preceding paths are stripped before parsing. Starting with \f(CW\*(C`PAR::Dist\*(C'\fR 0.22, versions containing a preceding \f(CW\*(C`v\*(C'\fR are parsed correctly. .PP This function is not exported by default. .SS generate_blib_stub .IX Subsection "generate_blib_stub" Creates a \fIblib/lib\fR subdirectory in the current directory and prepares a \fIMETA.yml\fR with meta information for a new PAR distribution. First argument should be the name of the PAR distribution in a format understood by \f(CWparse_dist_name()\fR. Alternatively, named arguments resembling those of \&\f(CW\*(C`blib_to_par\*(C'\fR are accepted. .PP After running \f(CW\*(C`generate_blib_stub\*(C'\fR and injecting files into the \fIblib\fR directory, you can create a PAR distribution using \f(CW\*(C`blib_to_par\*(C'\fR. This function is useful for creating custom PAR distributions from scratch. (I.e. not from an unpacked CPAN distribution) Example: .PP .Vb 2 \& use PAR::Dist; \& use File::Copy \*(Aqcopy\*(Aq; \& \& generate_blib_stub( \& name => \*(AqMyApp\*(Aq, version => \*(Aq1.00\*(Aq \& ); \& copy(\*(AqMyApp.pm\*(Aq, \*(Aqblib/lib/MyApp.pm\*(Aq); \& blib_to_par(); # generates the .par file! .Ve .PP \&\f(CW\*(C`generate_blib_stub\*(C'\fR will not overwrite existing files. .SS contains_binaries .IX Subsection "contains_binaries" This function is not exported by default. .PP Opens a PAR archive tries to determine whether that archive contains platform-specific binary code. .PP Takes one named parameter: \fIdist\fR. If only one parameter is passed, it is treated as the \fIdist\fR parameter. (Have a look at the description in the \f(CW\*(C`FUNCTIONS\*(C'\fR section above.) .PP Throws a fatal error if the PAR archive could not be found. .PP Returns one if the PAR was found to contain binary code and zero otherwise. .SH "SEE ALSO" .IX Header "SEE ALSO" PAR, ExtUtils::Install, Module::Signature, LWP::Simple .SH AUTHORS .IX Header "AUTHORS" Audrey Tang 2003\-2007 .PP Steffen Mueller 2005\-2011 .PP PAR has a mailing list, , that you can write to; send an empty mail to to join the list and participate in the discussion. Archives of the mailing list are available at or . .PP Please send bug reports to . .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2003\-2011 by Audrey Tang . .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP See