#!/usr/bin/perl use strict; # use warnings; use Getopt::Long qw(:config no_ignore_case auto_version auto_help); use PPM::Make; use Pod::Usage; $main::VERSION = $PPM::Make::VERSION; my %opts = (); my @files = (); my %progs = (); GetOptions(\%opts, 'zip_archive|z', 'force|f', 'ignore|i', 'cpan', 'no_cfg', 'no-cfg', 'no_case', 'binary|b:s', 'arch_sub|n', 'script|s:s', 'exec|e:s', 'os|o:s', 'arch|a:s', 'remove|r', 'as|A!', 'vs|V', 'vsr', 'vsp', 'zipdist', 'add|x:s' => \@files, 'program|p:s' => \%progs, 'ppd:s', 'ar:s', 'zip:s', 'host:s', 'user:s', 'passwd:s', 'no-ppm4', 'no-html', 'no-remote-lookup', 'skip', ) or pod2usage(2); my $dist = shift; my %upload = (); for (qw(binary script exec add program ppd ar host user passwd)) { die "Please supply an argument to '$_'" if ( defined $opts{$_} and $opts{$_} eq ""); } for (qw(ppd ar host user passwd zip)) { $upload{$_} = delete $opts{$_}; } $opts{upload} = \%upload if defined $upload{ppd}; $opts{dist} = $dist if $dist; for (qw(cfg ppm4 html remote-lookup)) { my $given = 'no-' . $_; next unless $opts{$given}; my $passed = 'no_' . $_; $passed =~ s/-/_/g; $opts{$passed} = delete $opts{$given}; } my $ppm = PPM::Make->new(%opts); $ppm->make_ppm(); __END__ =head1 NAME make_ppm - make a PPM distribution =head1 SYNOPSIS make_ppm [options] [Module | Distribution] Options: [-z | --zip] : make a zip distribution [-f | --force] : force remaking a distribution [-i | --ignore] : ignore any failing test results [ --skip] : skip running the tests [-b | --binary] location : specify the binary location [-n | --arch_sub] : use \$Config{archname} as a subdirectory [-s | --script] script : specify a script in the field [-e | --exec] exec : specify the executable to run the script [-x | --add] file : add file to the archive [-o | --os] os : use os for the field [-a | --arch] arch : use arch for the field [-v | --version] : print version information and exit [-h | --help] : print this help screen [-r | --remove] : remove the build directory after installation [-p | --program] b=a : specify "a" to be used for the "b" program [-A | --as] : add Perl version number to ARCHITECTURE (>= 5.8) [-V | --ppmv] : add version string to ppd and archive filenames [ --ppd ] location : copy the ppd to the specified location [ --ar ] location : copy the archive file to the specified location [ --zip ] location : copy the zipped file to the specified location [ --host] host : use the specified host for copying the ppm files [ --user] user : username to use when transferring ppm files [ --passwd] password : password associated with user [ --cpan ] : make a CPAN distribution [ --no_case ] : for module searches, ignore case [ --no-case ] : for module searches, ignore case [ --no_cfg ] : do not read a .ppmcfg configuration file [ --no-remote-lookup] : don't use external data sources for meta information [ --vsr] : add version string to the archive filename [ --vsp] : add version string to the ppd filename [ --zipdist] : create a zip file of the .ppd and .tar.gz files [ --no-ppm4] : don't add ppm4 extensions to the ppd file [ --no-html] : don't generate html documentation Additional Arguments: Module : specify a module to fetch (requires CPAN.pm) Distribution : specify a distribution to fetch With no arguments, make_ppm will build a distribution inside the current directory. =head1 DESCRIPTION C is an interface to the C module, and is used to build a PPM (Perl Package Manager) distribution from a CPAN source distribution. See L for a discussion. Apart from the options described below, without any arguments C will assume it is inside an unpacked source distribution and make the corresponding PPM distribution. If it is given an argument of what looks like a module name (eg, I), it will use C to look up the corresponding distribution and fetch and build it. Otherwise, additional arguments (eg, F, or I) will be interpreted as distributions to fetch and build. Options can be read from a configuration file (see L) and/or given as options to I, unless the I option is given. An example C<.ppmcfg> file is [default] host = me.wherever.ca user = me passwd = whatever [ MSWin32-x86-multi-thread-5.8 ] binary = http://me.wherever.ca/ppms/x86/ ppd = /usr/local/httpd/htdocs/ppms/ ar = /usr/local/httpd/htdocs/ppms/x86/ zip = /usr/local/httpd/htdocs/ppms/zips zipdist = 1 reps = < take precedence. Available options include: =over =item [-z | --zip] By default, C will build a C<.tar.gz> distribution if possible. This option forces a C<.zip> distribution to be made. =item [-f | --force] By default, if C detects a F directory, it will assume the distribution has already been made, and will not remake it. This option forces remaking the distribution. =item [-i | --ignore] By default, C, if it is building the distribution, will die if all tests do not pass. Turning on this option instructs C to ignore any test failures. =item [ --skip ] Setting this option will skip running any tests supplied with the package. =item [-b | --binary] location I is used as the value for the C attribute passed to C, and is used in setting the I attribute of the I field in the ppd file. =item [-n | --arch_sub] This option will insert the value of C<$Config{archname}> (or the value of the I<-a> option, if given) as a relative subdirectory in the I attribute of the I field in the ppd file. =item [-o | --os] os If this option is specified, the value, if present, will be used instead of the default for the I attribute of the I field of the ppd file. If no value is supplied, the I field will not be included in the ppd file. =item [-a | --arch] arch If this option is specified, the value, if present, will be used instead of the default for the I attribute of the I field of the ppd file. If no value is specified, the I field will not be included in the ppd file. =item [-s | --script] script This will be used in the I attribute passed to C, and arises in setting the value of the I field in the ppd file. If this begins with I or I, so that the script is assumed external, this will be used as the I attribute for I. =item [-e | --exec] exec This will be used in the I attribute passed to C, and arises in setting the I attribute of the I field in the ppd file. =item [-x | --add] file This option, which can be specified multiple times, can be used to add additional files outside of the the F directory to the archive. =item [-r | --remove] If specified, the directory used to build the ppm distribution given on the command line will be removed after a successful install. =item [-p | --prog] program=/path/to/program This option specifies that C should be used for C, rather than the one PPM::Make finds. This option can be specified multiple times, with C being one of C, C, C, C, or C. =item [--ppd] $path_to_ppd_files If given, this will copy the ppd file to the location specified, and must be given as an absolute pathname. If I is specified, this copy will be done via ftp, otherwise a local copy is made. =item [--ar] $path_to_archive_file This is the location where the archive file should be placed. This may either be an absolute pathname or a relative one, in which case it is interpreted to be relative to that specified by I. If this is not given, but I is specified, this will default to the value of I. =item [--zip] $path_to_zip_file This is the location where the zipped file created with the I<--zipdist> options should be placed. This may either be an absolute pathname or a relative one, in which case it is interpreted to be relative to that specified by I. If this is not given, but I is specified, this will default to the value of I. =item [--host] $hostname If specified, an ftp transfer to the specified host is done, with I and I as described above. =item [--user] $username This specifies the user name to login as when transferring via ftp. =item [--passwd] $passwd This is the associated password to use for I =item [-A | --as] Beginning with Perl-5.8, Activestate adds the Perl version number to the NAME of the ARCHITECTURE tag in the ppd file. This option, which is enabled by default, will make a ppd file compatible with this practice. Specify C<--noas> to disable this option. =item [-V | --vs] This option will add a version string (based on the VERSION reported in the ppd file) to the ppd and archive filenames. =item [--vsr] This option, if enabled, will add a version string (based on the VERSION reported in the ppd file) to the archive filename. =item [--vsp] This option, if enabled, will add a version string (based on the VERSION reported in the ppd file) to the ppd filename. =item [--zipdist] If enabled, this option will create a zip file C consisting of the C ppd file and the C archive file, suitable for local installations. A short README file giving the command for installation is also included. =item [--cpan] If specified, a distribution will be made using C which will include the I and I file. =item [--no_case] If specified, module searches will be performed in a case-insensitive manner. =item [--no_cfg] If specified, do not attempt to read a F<.ppmcfg> configuration file. =item [--no-cfg] If specified, do not attempt to read a F<.ppmcfg> configuration file. =item [--no-ppm4] If specified, do not add ppm4 extensions (such as the I element) to the ppd file. =item [--no-html] If specified, do not build html documentation. =item [--no-remote-lookup] If specified, do not query remote data sources for meta information. =item [--help] This prints out a short help screen and exits. =item [--version] This prints out some version information and exits. =back =head1 COPYRIGHT This program is copyright, 2002, by Randy Kobes Er.kobes@uwinnipeg.caE. It is distributed under the same terms as Perl itself. =head1 SEE ALSO L, and L. =cut