Skip to content

The portable, cross-platform, extensible, and simple package manager for tarballs (and others!)

License

Notifications You must be signed in to change notification settings

Alessandro-Salerno/tarman

tarman

The portable, cross-platform, extensible, and simple package manager for tarballs (and others!)

Contributors Forks Stargazers Issues MIT License

Why tarman?

Archives are often used in the Linux world to distribute packages that work on all distros, but this often comes with the caveat of having to manually manage the installation and, worst of all, updates. One notable example is Discord which only provides packages for Debian-based distros, while everybody else is left with a tar.gz archive which contains a version of the program that can't even update itself.

Some distros try to solve the issue by letting their users create and distribute packages (see Arch User Repository), but obviously this means downloading software from unofficial sources which may break the ToS and can potentially be dangerous.

Tarman solves this by automating the steps you would have to follow to install archives as packages. Much like a regular package manager, it is able to install packages from local files, URLs and repositories.

How to install tarman

You can install tarman... with tarman...

On Linux (x86-64):

curl -L "https://github.com/Alessandro-Salerno/tarman/raw/refs/heads/latest-build/linux-x86_64/tarman" -o ./tarman && chmod +x ./tarman && ./tarman add-repo "https://github.com/Alessandro-Salerno/tarman-user-repository/raw/refs/heads/latest-repos/linux-x86_64.tar.gz" && ./tarman install -r tarman && rm ./tarman

On Linux (ARM64 - AARCH64):

curl -L "https://github.com/Alessandro-Salerno/tarman/raw/refs/heads/latest-build/linux-arm64/tarman" -o ./tarman && chmod +x ./tarman && ./tarman add-repo "https://github.com/Alessandro-Salerno/tarman-user-repository/raw/refs/heads/latest-repos/linux-arm64.tar.gz" && ./tarman install -r tarman && rm ./tarman

On macOS (Apple Silicon - ARM64 - AARCH64):

curl -L "https://github.com/Alessandro-Salerno/tarman/raw/refs/heads/latest-build/macos-arm64/tarman" -o ./tarman && chmod +x ./tarman && ./tarman add-repo "https://github.com/Alessandro-Salerno/tarman-user-repository/raw/refs/heads/latest-repos/macos-arm64.tar.gz" && ./tarman install -r tarman && rm ./tarman

On macOS (Intel - x86_64):

curl -L "https://github.com/Alessandro-Salerno/tarman/raw/refs/heads/latest-build/macos-x86_64/tarman" -o ./tarman && chmod +x ./tarman && ./tarman add-repo "https://github.com/Alessandro-Salerno/tarman-user-repository/raw/refs/heads/latest-repos/macos-x86_64.tar.gz" && ./tarman install -r tarman && rm ./tarman

Important

To use tarman properly, you'll have to add it to your PATH environment variable. This procedure depends on you Shell, with bash for example:

echo "export PATH=~/.tarman/path/:\$PATH" >> ~/.bashrc && source ~/.bashrc

How to use tarman

This is a CLI tool, so the only way to interact with it (at the moment) is through the terminal. After installing it, type tarman help for a list of all commands and options.

Installing packages

To install a package you can use the tarman install command with the following options:

  • -u Downloads from a URL (e.g., tarman install -u https://some.domain/some/path/archive.tar.gz)
  • -r Downloads from a repository using a recipe (e.g., tarman install -r nvim)
  • -f Is often used with -u to set the archive format (e.g., -f zip)
  • If neither -u nor -r are specified, tarman will assume that you have an archive locally (e.g., tarman install ~/Downloads/program.tar.gz)

Updating packages

To update an installed package, assuming that your local repositories are up-to-date, just type:

tarman update <package name>

Removing packages

To remove a package, simply type:

tarman remove <package name>

Warning

This command can be used to remove tarman itself. Be careful!

Adding repositories

To add repositories from remote URLs, you can use the following command:

tarman add-repo <URL>

Removing a repository

To remove a repository, use:

tarman remove-repo <repo name>

Warning

This command can be used to remove the tarman user repository from which tarman itself is intalled and updated. Be careful!

Portable?

Archives have the advantage of being universal. The tar format, for example, is standardized and documented, thus anyone with the right know-how can create their own program to archive and extract tarballs. Tarman is designed to take advantage of this, its source code is structured in a way that should make it very easy to port to operating systems other than GNU/Linux. In fact, there's a working port for macOS (Darwin)!

Tarman should be fit for hobby operating systems since it leaves most concrete aspects to the OS-specific implementation and avoids the use of advanced OS features (e.g., dynamic linking with dlopen).

See the documentation for more information.

Extensible?

Tarman has a tiny core and is very modular. There's no code to extract archives or download files in the core program, instead tarman relies on other programs. By default, it attempts to call tar and curl from the PATH environment variable, but plugins can be written and installed to support other backends and file formats!

See the documentation for more information.

How to build tarman

Using the included Makefile:

make debug        # Compile the whole program (plugins included) in debug mode
make release      # Compile the whol program (plugins included) in release mode
make plugin-sdk   # Compile ONLY the Plugin SDK
make plugins      # Compile the Pugin SDK and all built-in plugins

License

Tarman is distributed under the GNU General Public License v3.0 or later. This only applies to the core source code (and headers) of the program, files added by contributors may be distributed under different licenses. The license is always stated at the beginning of each source file. The copyright notice at the top of each source file states the name of the original creator of the file, copyright for changes and contributions however belongs to their authors.

The list of authors can be found here

Contributing

There's much to be done here, so if you want to contribute, go ahead! Read (and expand) the documentation and the CONTRIBUTING file and take not of the license policy stated above.