Alessandro Mauri
7fc4f775ac
|
4 years ago | |
---|---|---|
posix | 4 years ago | |
.gitignore | 4 years ago | |
LICENSE | 4 years ago | |
PROCESS.md | 4 years ago | |
README.md | 4 years ago | |
TODO.md | 4 years ago |
README.md
tarinstall
An alternative to AppImages, flatpacks and snaps to let the user install an application as a single executable file when static linking is not possible
tarinstall does not include any external files as such it does not include any man pages, example configuration files, etc. All of those have to be installed separately.
Graph
An application packaged as a tarinstall is made as such
----- Decompressor -----
| |
| |
|------- Loader -------|
| |
| |
|----- App Tarball ----|
| |
| bin/ |
| lib/ |
| man/ |
| ext/ |
| env |
| checksum |
| id |
| |
------------------------
Decompressor: It decompresses the archive and then runs the loader
Loader: It reads the env
file in the tarball and enumerates the lib/
directory to loads all the necessary libraries and sets the correct environment
before executing the correct binary in the bin/
directory.
This may include changing the RPATH section of the binaries inside bin/
Files and folders
lib/
: contains the required shared librariesbin/
: will substitutePATH
and contains all the binaries that the application requires, such as POSIX utilities, a python interpreter, etc. As well as the application's binariesman/
: contains the manual pages for the biaries inapp
ext/
: contains all other files, such as example configurations, etc.env
: lists the cutom environment variables to start the applicationchecksum
: contains the checksum of the applicationid
: contains the application id
Utilities
User
tarman
: get manual pages from a tarinstall applicationtarext
: extract the files inext/
tarup
: tries to find a newer version of the application using it'sid
andchecksum
and updates it using a differential algorithm
Devs
tarpack
: package a tarinstall application
TODO
- Find a way to include external files
- Include a package manager
- App binary diffs for incremental upgrades
- Automated tarinstall packaging for developers
- Package manager for shared objects (libraries)
- Standardized way to define dependencies
Advantages
- Allows for application compression
- Simpler and configyred in plaintext
- Does not include any external dependencies other than optional ones
- It can be used alongside other package managers and package formats
Compression is optional, it can be used to produce smaller packages but also increments latency wich may be unwanted.
Configuration
When the application is started the decompressor extracts the directory
structure into a temporary directory in the filesystem in order to start it.
This directory can be configured trough the XDG_CACHE_HOME
enviroment variable
and if not set it will default to /tmp/ti-<appname>
, to ensure optimal
performance the XDG_CACHE_HOME
directory should be mounted on RAM, that said
if mounted on permanent storage altough the start times will be worse, the
files will only be overritten if the checksum changes so to not require
the extraction everytime.
How it works
- On executing the tarinstall the decompressor is executed which:
- If the checksum matches the one in the destination directory it skips the extraction
- Else it extracts the content of the tar application in the destination directory
- The decompressor then executes the loader inside the destination directory
which:
- It sets environment according to the
env
file - It overrides the loader libraries with the contents of
lib/
- it enters the
bin/
directory and executes the binary namedargv[0]
with all the passed arguments
- It sets environment according to the
Upon packaging the tarinstall all the executables in the bin/
directory are
modified so that their RPATH
points to lib/
.
Examples
Simple example, one binary in bin/
/home/anon/.local/bin/
foo.ti
/bin/
foo -> /home/anon/.local/bin/foo.ti
- executing
foo -h
startsbin/foo -h
insidefoo.ti
- trying to execute
foo.ti
directly results in the execution of the only binary inbin/
More complex example, multiple biaries inside bin/
/home/anon/.local/bin/
foo.ti
/bin/
foo -> /home/anon/.local/bin/foo.ti
bar -> /home/anon/.local/bin/foo.ti
baz -> /home/anon/.local/bin/foo.ti
- executing
foo -v
startsbin/foo -v
insidefoo.ti
- executing
bar -h
startsbin/bar -h
insidefoo.ti
- executing
baz -o file
startsbin/baz -o file
insidefoo.ti
- executing
foo.ti
directly results in the execution of the binary namedfoo
insidebin/
, if it doesn't exist
Language
- POSIX shell (tools)
- C (loader and decompressor)