starch1
Standalone application archiver
Usage
FCstarch [options]
<sfx_path>FT
Overview
Starch is a script that creates standalone application archives in the form of self-extracting executables (FCSFXFT). Users may specify the command, executables, libraries, data, and environment scripts associated with the application by specifying the appropriate command line options or by using a configuration file. starch is particularly useful for distributed computing, in that it makes an executable portable across different operating system variants.
Options
To create a FCSFXFT, simply specify the name of the FCSFXFT to create along with the <command> to execute and any other dependencies such as <executables>, <libraries>, <data>, or <environment> scripts.
If a <command> is specified, but no <executable> is passed, then the first token in the <command> will be used as the executable.
By default, FCstarchFT will use FClddFT to detect any necessary libraries from the specified set of <executables> and include them in the FCSFXFT.
-
-A -
Do not automatically detect library dependencies.
-
-C <cfg> -
Use configuration file.
-
-c <cmd> -
Specify command to execute.
-
-d <npath:opath> -
Add data (new path:old path).
-
-e <env> -
Add environment script.
-
-l <lib> -
Add library.
-
-x <exe> -
Add executable.
-
-h -
Show help message and exit.
-
-v -
Display verbose messages (default: False).
Once a FCSFXFT is generated, you can use it as a normal executable.
Configuration file
The command line options may be stored in a configuration file and passed to starch using the FCstarch -CFT option. The format of the configuration file is as follows:
-
[starch] executables = echo date hostname libraries = libz.so data = hosts.txt:/etc/hosts localtime:/etc/localtime images:/usr/share/pixmaps command = echo $(hostname) $(date $@)
Environment
The following environment variables will affect the execution of the FCSFXFT generated by FCstarchFT:
Sfx_dir
Determines the target directory where the FCSFXFT will be extracted. By default this is FC/tmp/$hostname.$user.$basename.dirFT.
Sfx_extract_only
Only extract the FCSFXFT. By default it is extracted and executed.
Sfx_extract_force
Extract the FCSFXFT even if the FCSFX_DIRFT exists. This is disabled by default to as an optimization to avoid unnecessarily extracting.
Sfx_keep
Keep extracted files. By default the files will be removed after execution.
Sfx_unique
Use FCmktempdFT to generate a unique FCSFX_DIRFT target directory. This will prevent FCSFX_KEEPFT from working properly since the names will change in between invocations.
Exit status
On success, returns zero. On failure, returns non-zero.
Examples
Package the date program:
-
$ starch -c date -x date date.sfx
Package the date program using a configuration file:
-
$ cat data.cfg
[starch]
executables = date
command = date
$ starch -C date.cfg date.sfx
Run standalone date program with parameters:
-
$ ./date.sfx +%s
Only extract the archive:
-
$ env SFX_EXTRACT_ONLY=1 ./date.sfx
Run and keep extracted directory:
-
$ env SFX_KEEP=1 ./date.sfx
Run with unique directory:
-
$ env SFX_UNIQUE=1 ./date.sfx
Advanced example involving a complex shell command:
-
$ starch -v -x tar -x rm -c 'tar_test() { for f in $@; do if ! tar xvf $f; then exit 1; fi; done; rm $@'; }; tar_test' extract_and_remove.sfx
$ ./extract_and_remove.sfx *.tar.gz
Releases
4 releases since Debian 10 (Buster); the text changed 3 times.
-C since Debian 13 (Trixie);
-c since Debian 13 (Trixie);
-d since Debian 13 (Trixie);
-e since Debian 13 (Trixie);
-l since Debian 13 (Trixie);
-x since Debian 13 (Trixie).