… | |
… | |
5 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
6 | |
6 | |
7 | use Urlader; |
7 | use Urlader; |
8 | |
8 | |
9 | =head1 DESCRIPTION |
9 | =head1 DESCRIPTION |
|
|
10 | |
|
|
11 | Urlader (that's german for "bootloader" btw.) was created out of |
|
|
12 | frustration over PAR again not working, again not being flexible enough |
|
|
13 | for simple things, and again causing mysterious missing files issues on |
|
|
14 | various platforms. |
|
|
15 | |
|
|
16 | That doesn't mean this module replaces PAR, in fact, you should stay with |
|
|
17 | it for many reasons, user-friendlyness is one of them. |
|
|
18 | |
|
|
19 | However, if you want to make single-file distributions out of your perl |
|
|
20 | programs (or python, or C or whatever), and you are prepared to fiddle a |
|
|
21 | LOT, this module might provide a tiny step towards your goal. Well, if it |
|
|
22 | ever gets finished. |
|
|
23 | |
|
|
24 | Also, I<nothing in this module is considered very stable yet>, and it's |
|
|
25 | far from feature-complete. |
|
|
26 | |
|
|
27 | Having said all that, Urlader basically provides three services: |
|
|
28 | |
|
|
29 | =over 4 |
|
|
30 | |
|
|
31 | =item A simple archiver that packs a directory tree into a single file. |
|
|
32 | |
|
|
33 | =item A small C program that works on windows and unix, which unpacks an attached |
|
|
34 | archive and runs a program. |
|
|
35 | |
|
|
36 | =item A perl module support module (I<this one>), that can be used to query |
|
|
37 | the runtime environment, find out where to install updates and so on. |
|
|
38 | |
|
|
39 | =back |
|
|
40 | |
|
|
41 | =head1 EXAMPLE |
|
|
42 | |
|
|
43 | How can it be used to provide single-file executables? |
|
|
44 | |
|
|
45 | So simple, create a directory with everything that's needed, e.g.: |
|
|
46 | |
|
|
47 | # find bintree |
|
|
48 | bintree/perl |
|
|
49 | bintree/libperl.so.5.10 |
|
|
50 | bintree/run |
|
|
51 | bintree/pm/Guard.pm |
|
|
52 | bintree/pm/auto/Guard/Guard.so |
|
|
53 | |
|
|
54 | # cat bintree/run |
|
|
55 | @INC = ("pm", "."); # "." works around buggy AutoLoader |
|
|
56 | use Guard; |
|
|
57 | guard { warn "hello, world!\n" }; # just to show off |
|
|
58 | exit 0; # tell the urlader that everything was fine |
|
|
59 | |
|
|
60 | Then pack it: |
|
|
61 | |
|
|
62 | # wget http://urlader.schmorp.de/prebuilt/1.0/linux-x86 |
|
|
63 | # urlader-util --urlader linux-x86 --pack myprog ver1_000 bintree \ |
|
|
64 | LD_LIBRARY_PATH=. ./perl run \ |
|
|
65 | >myprog |
|
|
66 | # chmod 755 myprog |
|
|
67 | |
|
|
68 | =head1 CONCEPTS |
|
|
69 | |
|
|
70 | =over 4 |
|
|
71 | |
|
|
72 | =item urlader |
|
|
73 | |
|
|
74 | A small (hopefully) and relatively portable (hopefully) binary that is |
|
|
75 | prepended to a pack file to make it executable. |
|
|
76 | |
|
|
77 | You can build it yourself from sources (see F<prebuilt/Makefile> in the |
|
|
78 | distribution) or use one of the precompiled ones at: |
|
|
79 | |
|
|
80 | http://urlader.schmorp.de/prebuilt/1.0/ |
|
|
81 | |
|
|
82 | The F<README> there has further information on the binaries provided. |
|
|
83 | |
|
|
84 | =item exe_id |
|
|
85 | |
|
|
86 | A string that uniquely identifies your program - all branches of it. It |
|
|
87 | must consist of the characters C<A-Za-z0-9_-> only and should be a valid |
|
|
88 | directory name on all systems you want to deploy on. |
|
|
89 | |
|
|
90 | =item exe_ver |
|
|
91 | |
|
|
92 | A string the uniquely identifies the contents of the archive, i.e. the |
|
|
93 | version. It has the same restrictions as the C<exe_id>, and should be |
|
|
94 | fixed-length, as Urlader assumes lexicographically higher versions are |
|
|
95 | newer, and thus preferable. |
|
|
96 | |
|
|
97 | =item pack file (archive) |
|
|
98 | |
|
|
99 | This contains the C<exe_id>, the C<exe_ver>, a number of environment |
|
|
100 | variable assignments, the program name to execute, the initial arguments |
|
|
101 | it receives, and finally, a list of files (with contents :) and |
|
|
102 | directories. |
|
|
103 | |
|
|
104 | =item override |
|
|
105 | |
|
|
106 | =back |
|
|
107 | |
|
|
108 | =head1 FUNCTIONS AND VARIABLES IN THIS MODULE |
10 | |
109 | |
11 | =over 4 |
110 | =over 4 |
12 | |
111 | |
13 | =cut |
112 | =cut |
14 | |
113 | |