dump /usr/bin/env perl from shebang
[p5sagit/App-FatPacker.git] / bin / fatpack
CommitLineData
cf20bfa3 1#!/usr/bin/perl
a5e340ba 2
3use App::FatPacker -run_script;
4
5=head1 NAME
6
7fatpack - Command line frontend for App::FatPacker
8
9=head1 COMMANDS
10
6da38a2d 11=head2 pack
12
13 $ fatpack pack myscript.pl > myscript.packed.pl
14
15A shortcut to do all the work of tracing, collecting packlists,
a5a1d543 16extracting modules in fatlib, then concatenating into a packed script
6da38a2d 17- in one shot. If you need more detailed controls for additional
18modules, use the following commands separately (see L</RECIPES>).
19
a5e340ba 20=head2 trace
21
3fdf85ca 22 $ fatpack trace [--to=trace-file|--to-stderr] [--use=MODULE]
23 myscript.pl
a5e340ba 24
25Compiles myscript.pl (as in "perl -c") and writes out a trace file containing
26every module require()d during the compilation.
27
28The trace file is called 'fatpacker.trace' by default; the --to option
29overrides this.
30
31If you pass --to-stderr fatpack writes the trace to STDERR instead.
32
33You cannot pass both --to and --to-stderr.
34
3fdf85ca 35If the --use option specifies a module (or modules, if used multiple
36times) those modules will be additionally included in the trace output.
37
a5e340ba 38=head2 packlists-for
39
40 $ fatpack packlists-for Module1 Module2 Module3
41
42Searches your perl's @INC for .packlist files containing the .pm files for
43the modules requested and emits a list of unique packlist files to STDOUT.
44
45These packlists will, in a pure cpan-installation environment, be all non-core
46distributions required for those modules.
47
48Unfortunately most vendors strip the .packlist files so if you installed
49modules via e.g. apt-get you may be missing those modules; installing your
50dependencies into a L<local::lib|local::lib> first is the preferred workaround.
51
52=head2 tree
53
54 $ fatpack tree fatlib packlist1 packlist2 packlist3
55
56Takes a list of packlist files and copies their contents into a tree at the
57requested location.
58
59This tree should be sufficient to 'use lib' to make available all modules
60provided by the distributions whose packlists were specified.
61
62=head2 file
63
64 $ fatpack file
65
66Recurses into the 'lib' and 'fatlib' directories and bundles all .pm files
67found into a BEGIN block which adds a virtual @INC entry to load these files
68from the bundled code rather than disk.
69
70=head1 RECIPES
71
72Current basic recipe for packing:
73
74 $ fatpack trace myscript.pl
a884f0d7 75 $ fatpack packlists-for `cat fatpacker.trace` >packlists
76 $ fatpack tree `cat packlists`
7dabafaa 77 $ fatpack file myscript.pl >myscript.packed.pl
cb50b68f 78
a5e340ba 79=head1 COPYRIGHT, LICENSE, AUTHOR
80
81See the corresponding sections in L<App::FatPacker>.
82
83=cut