| 1 | package pp; # Now people can say "install pp" in the CPAN shell. | ||
| 2 | use 5.006; | ||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use PAR::Packer (); | ||
| 6 | |||
| 7 | # This line is here so CPAN.pm can parse a $VERSION from us... | ||
| 8 | our $VERSION = '0.992'; | ||
| 9 | |||
| 10 | # ...but we read our $VERSION again from PAR::Packer in case we forgot to update | ||
| 11 | # the $VERSION above during release engineering. | ||
| 12 | $VERSION = $PAR::Packer::VERSION; | ||
| 13 | |||
| 14 | use PAR (); | ||
| 15 | use Module::ScanDeps (); | ||
| 16 | use App::Packer::PAR (); | ||
| 17 | use Getopt::ArgvFile default=>1, resolveEnvVars=>1; | ||
| 18 | use Getopt::Long qw(:config no_ignore_case); | ||
| 19 | |||
| 20 | |||
| 21 | sub go { | ||
| 22 | my $class = shift; | ||
| 23 | |||
| 24 | if ($ENV{PP_OPTS}) { | ||
| 25 | require Text::ParseWords; | ||
| 26 | unshift @ARGV, Text::ParseWords::shellwords($ENV{PP_OPTS}); | ||
| 27 | } | ||
| 28 | |||
| 29 | my %opt; | ||
| 30 | GetOptions( \%opt, PAR::Packer->options, 'h|help', 'V|version' ) | ||
| 31 | or die qq[Run "$0 --help" to show available options.\n]; | ||
| 32 | help() if $opt{h}; | ||
| 33 | version() if $opt{V}; | ||
| 34 | |||
| 35 | local $Module::ScanDeps::ScanFileRE = qr/./; | ||
| 36 | |||
| 37 | App::Packer::PAR->new( | ||
| 38 | frontend => 'Module::ScanDeps', | ||
| 39 | backend => 'PAR::Packer', | ||
| 40 | frontopts => \%opt, | ||
| 41 | backopts => \%opt, | ||
| 42 | args => \@ARGV, | ||
| 43 | )->go; | ||
| 44 | |||
| 45 | return 1; | ||
| 46 | } | ||
| 47 | |||
| 48 | sub help { | ||
| 49 | print "PAR Packager, version $VERSION (PAR version $PAR::VERSION)\n\n"; | ||
| 50 | { | ||
| 51 | no warnings; | ||
| 52 | exec "perldoc $0"; | ||
| 53 | exec "pod2text $0"; | ||
| 54 | } | ||
| 55 | version(); | ||
| 56 | } | ||
| 57 | |||
| 58 | sub version { | ||
| 59 | print << "."; | ||
| 60 | PAR Packager, version $VERSION (PAR version $PAR::VERSION) | ||
| 61 | Copyright 2002-2009 by Audrey Tang <cpan\@audreyt.org> | ||
| 62 | |||
| 63 | Neither this program nor the associated "parl" program impose any | ||
| 64 | licensing restrictions on files generated by their execution, in | ||
| 65 | accordance with the 8th article of the Artistic License: | ||
| 66 | |||
| 67 | "Aggregation of this Package with a commercial distribution is | ||
| 68 | always permitted provided that the use of this Package is embedded; | ||
| 69 | that is, when no overt attempt is made to make this Package's | ||
| 70 | interfaces visible to the end user of the commercial distribution. | ||
| 71 | Such use shall not be construed as a distribution of this Package." | ||
| 72 | |||
| 73 | Therefore, you are absolutely free to place any license on the resulting | ||
| 74 | executable, as long as the packed 3rd-party libraries are also available | ||
| 75 | under the Artistic License. | ||
| 76 | |||
| 77 | This program is free software; you can redistribute it and/or modify it | ||
| 78 | under the same terms as Perl itself. There is NO warranty; not even for | ||
| 79 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| 80 | |||
| 81 | . | ||
| 82 | exit; | ||
| 83 | } | ||
| 84 | |||
| 85 | __END__ |