.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 "Module::Install::PAR 3pm" .TH Module::Install::PAR 3pm 2024-03-06 "perl v5.38.2" "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 Module::Install::PAR \- Module::Install Support for PAR::Dist packages .SH SYNOPSIS .IX Header "SYNOPSIS" To offer your users the possibility to install binaries if we cannot compile an XS version of the module, you could use this simplistic stub: .PP .Vb 1 \& use inc::Module::Install; \& \& name \*(AqFoo\*(Aq; \& all_from \*(Aqlib/Foo.pm\*(Aq; \& \& # Which CPAN directory do we fetch binaries from? \& par_base \*(AqSMUELLER\*(Aq; \& \& unless ( can_xs ) { \& my $okay = extract_par( fetch_par ); \& if (not $okay) { \& die "No compiler and no binary package found. Aborting.\en"; \& } \& } \& \& WriteAll; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module adds a couple of directives to Module::Install related to installing and creating PAR::Dist distributions. .SS par_base .IX Subsection "par_base" This directive sets the CPAN ID from whose CPAN directory to fetch binaries from. For example, you can choose to download binaries from http://www.cpan.org/authors/id/S/SM/SMUELLER/ or its ftp counterpart by writing: .PP .Vb 1 \& par_base \*(AqSMUELLER\*(Aq; .Ve .PP By default, the name of the file to fetch is generated from the distribution name, its version, your platform name and your perl version concatenated with dashes. .PP The directive, however, takes an optional second argument which specifies the name of the file to fetch. (Though \f(CW\*(C`par_base\*(C'\fR does not fetch files itself, see below.) .PP .Vb 1 \& par_base \*(AqSMUELLER\*(Aq, \*(Aqfoo\*(Aq; .Ve .PP Once \f(CW\*(C`fetch_par\*(C'\fR is called, the file 'foo' will be downloaded from SMUELLER's CPAN directory. (It doesn't exist.) .PP The second argument could be used to fetch platform-agnostic binaries: .PP .Vb 1 \& par_base \*(AqSMUELLER\*(Aq, "Some\-Distribution\-0.01.par"; .Ve .PP (Documentation TODO: Use the previously defined distribution name and version in example.) .SS fetch_par .IX Subsection "fetch_par" Fetches the .par file previously referenced in the documentation of the \f(CW\*(C`par_base\*(C'\fR directive. .PP \&\f(CW\*(C`fetch_par\*(C'\fR can be used without arguments given the \f(CW\*(C`par_base\*(C'\fR directive was used before. It will return the name of the file it fetched. .PP If the first argument is an URL or a CPAN user ID, the file is fetched from that directory unless an URL has been previously set. (Read that again.) .PP If the second argument is a file name it is used as the name of the file to download. .PP If the file could not be fetched, a suitable error message about no package being available, yada yada yada, is printed. You can turn this off by specifying a true third argument. .PP .Vb 3 \& # Try to fetch the package (see par_base) but \& # don\*(Aqt be verbose about failures \& my $file = fetch_par(\*(Aq\*(Aq, \*(Aq\*(Aq, undef); .Ve .SS extract_par .IX Subsection "extract_par" Takes the name of a PAR::Dist archive file as first argument. The 'blib/' directory of this archive is extracted and the 'pm_to_blib' is created. .PP Typical shorthand usage: .PP .Vb 1 \& extract_par( fetch_par ) or die "Could not install PAR::Dist archive."; .Ve .SS make_par .IX Subsection "make_par" This directive requires PAR::Dist (version 0.03 or up) on your system. (And checks that it is available before continuing.) .PP Creates a PAR::Dist archive from the 'blib/' subdirectory. .PP First argument must be the name of the PAR::Dist archive to create. .PP If your Makefile.PL has a \f(CW\*(C`par_base\*(C'\fR directive, the \f(CW\*(C`make par\*(C'\fR make target will be available. It uses this \f(CW\*(C`make_par\*(C'\fR directive internally, so on your development system, you can do this to create a .par binary archive for your platform: .PP .Vb 3 \& perl Makefile.PL \& make \& make par .Ve .SH AUTHOR .IX Header "AUTHOR" Audrey Tang .PP With documentation from Steffen Mueller .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (c) 2006. 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