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