7
Starch is a script that creates standalone application archives in the form of
8
self-extracting executables (SFX). Users may specify the command, executables,
9
libraries, data, and environment scripts associated with the application by
10
specifying the appropriate command line options or by using a configuration
11
file and passing it to starch.
16
Use the standard Python setup.py script as so::
25
Usage: starch.py [options] <sfx_path>
28
-h, --help show this help message and exit
29
-c cmd command to execute
32
-d npath:opath add data (new path:old path)
33
-e env add environment script
34
-C cfg configuration file
35
-a automatically detect library dependencies (default: True)
36
-A do not automatically detect library dependencies
37
-v display verbose messages (default: False)
42
Instead of specifying the command, executables, libraries, data, and
43
environment options on the command line, users may specify the settings in a
44
simple INI-style configuration file and pass that to starch. A simple example
45
configuration file looks like so::
48
executables = echo date hostname
50
data = hosts.txt:/etc/hosts localtime:/etc/localtime images:/usr/share/pixmaps
51
command = echo $(hostname) $(date $@)
53
In this example, we specify three executables: ``echo``, ``date``, and
54
``hostname``. We include the ``libz.so`` library and a collection of data
55
files. In this case, we copy ``/etc/hosts`` to ``hosts.txt``,
56
``/etc/localtime`` to ``localtime``, and we recursively copy the
57
``/usr/share/pixmaps`` directory to ``images``. Finally, we set our command to
58
simply print out the hostname and date.
60
Environmental Variables
61
-----------------------
63
The following environmental variables modify the behavior of the generated SFX
66
- **SFX_DIR**: Target directory where SFX will be extracted.
67
- **SFX_EXTRACT_ONLY**: Only extract the SFX (by default it will be extracted and ran).
68
- **SFX_EXTRACT_FORCE**: Extract the SFX even if target directory exists.
69
- **SFX_KEEP**: Keep extracted files (by default the files will be removed after execution).
70
- **SFX_UNIQUE**: Use ``mktempd`` to generate unique SFX target directory. This will prevent **SFX_KEEP** from working properly since the names will keep on changing.
75
Package the date program::
77
$ starch -x date date.sfx
79
Package the date program using a configuration file::
81
$ starch -C date.cfg date.sfx
83
Run standalone date program::
87
Only extract the archive::
89
$ env SFX_EXTRACT_ONLY=1 ./data.sfx
91
Run and keep extracted directory::
93
$ env SFX_KEEP=1 ./data.sfx
95
Run with unique directory::
97
$ env SFX_UNIQUE=1 ./data.sfx
99
Advanced example involving a complex shell command::
101
$ starch -v -x tar -x rm extract_and_remove.sfx 'for f in $@; do if ! tar xvf $f; then exit 1; fi; done; rm $@'
102
$ ./extract_and_remove.sfx *.tar.gz