ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/staticperl.pod
(Generate patch)

Comparing App-Staticperl/staticperl.pod (file contents):
Revision 1.19 by root, Fri Dec 10 15:25:24 2010 UTC vs.
Revision 1.20 by root, Fri Dec 10 20:29:17 2010 UTC

40 40
41With F<uClibc> and F<upx> on x86, you can create a single 500kb binary 41With F<uClibc> and F<upx> on x86, you can create a single 500kb binary
42that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO, 42that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO,
43Coro and so on. Or any other choice of modules. 43Coro and so on. Or any other choice of modules.
44 44
45To see how this turns out, you can try out smallperl and bigperl, two
46pre-built static and compressed perl binaries with many and even more
47modules: just follow the links at L<http://staticperl.schmorp.de/>.
48
45The created files do not need write access to the file system (like PAR 49The created files do not need write access to the file system (like PAR
46does). In fact, since this script is in many ways similar to PAR::Packer, 50does). In fact, since this script is in many ways similar to PAR::Packer,
47here are the differences: 51here are the differences:
48 52
49=over 4 53=over 4
152 156
153To force recompilation or reinstallation, you need to run F<staticperl 157To force recompilation or reinstallation, you need to run F<staticperl
154distclean> first. 158distclean> first.
155 159
156=over 4 160=over 4
161
162=item F<staticperl version>
163
164Prints some info about the version of the F<staticperl> script you are using.
157 165
158=item F<staticperl fetch> 166=item F<staticperl fetch>
159 167
160Runs only the download and unpack phase, unless this has already happened. 168Runs only the download and unpack phase, unless this has already happened.
161 169
311 319
312All this step does is potentially reduce the number of files already 320All this step does is potentially reduce the number of files already
313selected or found in phase 1. 321selected or found in phase 1.
314 322
315=item 3. find all modules (== F<.pm> files), gather their static archives 323=item 3. find all modules (== F<.pm> files), gather their static archives
316(F<.a>) and AutoLoader splitfiles (F<.ix> and F<.al> files) and find any 324(F<.a>) and AutoLoader splitfiles (F<.ix> and F<.al> files), find any
317extra libraries they need for linking (F<extralibs.ld>). 325extra libraries they need for linking (F<extralibs.ld>) and optionally
326evaluate any F<.packlist> files.
318 327
319This step is required to link against XS extensions and also adds files 328This step is required to link against XS extensions and also adds files
320required for L<AutoLoader> to do it's job. 329required for L<AutoLoader> to do it's job.
321 330
322=back 331=back
453(using a C<require>) before anything else when the new perl is 462(using a C<require>) before anything else when the new perl is
454initialised. This can be used to modify C<@INC> or anything else before 463initialised. This can be used to modify C<@INC> or anything else before
455the perl interpreter executes scripts given on the command line (or via 464the perl interpreter executes scripts given on the command line (or via
456C<-e>). This works even in an embedded interpreter. 465C<-e>). This works even in an embedded interpreter.
457 466
467=item --usepacklist
468
469Read F<.packlist> files for each distribution that happens to match a
470module name you specified. Sounds weird, and it is, so expect semantics to
471change somehow in the future.
472
473The idea is that most CPAN distributions have a F<.pm> file that matches
474the name of the distribution (which is rather reasonable after all).
475
476If this switch is enabled, then if any of the F<.pm> files that have been
477selected match an install distribution, then all F<.pm>, F<.pl>, F<.al>
478and F<.ix> files installed by this distribution are also included.
479
480For example, using this switch, when the L<URI> module is specified, then
481all L<URI> submodules that have been installed via the CPAN distribution
482are included as well, so you don't have to manually specify them.
483
458=item --incglob pattern 484=item --incglob pattern
459 485
460This goes through all library directories and tries to match any F<.pm> 486This goes through all library directories and tries to match any F<.pm>
461and F<.pl> files against the extended glob pattern (see below). If a file 487and F<.pl> files against the extended glob pattern (see below). If a file
462matches, it is added. This switch will automatically detect L<AutoLoader> 488matches, it is added. This switch will automatically detect L<AutoLoader>
589 615
590=back 616=back
591 617
592=head2 F<STATICPERL> CONFIGURATION AND HOOKS 618=head2 F<STATICPERL> CONFIGURATION AND HOOKS
593 619
594During (each) startup, F<staticperl> tries to source the following shell 620During (each) startup, F<staticperl> tries to source some shell files to
621allow you to fine-tune/override configuration settings.
622
623In them you can override shell variables, or define shell functions
624("hooks") to be called at specific phases during installation. For
625example, you could define a C<postinstall> hook to install additional
626modules from CPAN each time you start from scratch.
627
628If the env variable C<$STATICPERLRC> is set, then F<staticperl> will try
629to source the file named with it only. Otherwise, it tries the following
595files in order: 630shell files in order:
596 631
597 /etc/staticperlrc 632 /etc/staticperlrc
598 ~/.staticperlrc 633 ~/.staticperlrc
599 $STATICPERL/rc 634 $STATICPERL/rc
600
601They can be used to override shell variables, or define functions to be
602called at specific phases.
603 635
604Note that the last file is erased during F<staticperl distclean>, so 636Note that the last file is erased during F<staticperl distclean>, so
605generally should not be used. 637generally should not be used.
606 638
607=head3 CONFIGURATION VARIABLES 639=head3 CONFIGURATION VARIABLES
953 985
954If you want to handle IRIs or IDNs (L<AnyEvent::Util> punycode and idn 986If you want to handle IRIs or IDNs (L<AnyEvent::Util> punycode and idn
955functions), you also need to include C<"AnyEvent/Util/idna.pl"> and 987functions), you also need to include C<"AnyEvent/Util/idna.pl"> and
956C<"AnyEvent/Util/uts46data.pl">. 988C<"AnyEvent/Util/uts46data.pl">.
957 989
990Or you can use C<--usepacklist> and specify C<-MAnyEvent> to include
991everything.
992
958=item Carp 993=item Carp
959 994
960Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of 995Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of
961perl 5.12.2 (maybe earlier), this dependency no longer exists. 996perl 5.12.2 (maybe earlier), this dependency no longer exists.
962 997
966turn might need L<"Config_heavy.pl">. Including the latter gives you 1001turn might need L<"Config_heavy.pl">. Including the latter gives you
967both. 1002both.
968 1003
969=item Term::ReadLine::Perl 1004=item Term::ReadLine::Perl
970 1005
971Also needs L<Term::ReadLine::readline>. 1006Also needs L<Term::ReadLine::readline>, or C<--usepacklist>.
972 1007
973=item URI 1008=item URI
974 1009
975URI implements schemes as separate modules - the generic URL scheme is 1010URI implements schemes as separate modules - the generic URL scheme is
976implemented in L<URI::_generic>, HTTP is implemented in L<URI::http>. If 1011implemented in L<URI::_generic>, HTTP is implemented in L<URI::http>. If
977you need to use any of these schemes, you should include these manually. 1012you need to use any of these schemes, you should include these manually,
1013or use C<--usepacklist>.
978 1014
979=back 1015=back
980 1016
981=head2 RECIPES 1017=head2 RECIPES
982 1018

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines