Basic and simple packaging system
Find a file
2024-06-19 10:58:41 +02:00
completion change completion folder 2021-08-12 18:28:15 +02:00
scripts change completion folder 2021-08-12 18:28:15 +02:00
server_scripts fix(build): fix NOSUDO minify on build 2022-05-05 11:52:52 +02:00
src fix: use curl instead of wget 2024-06-19 10:58:41 +02:00
.gitignore rename .config to .zpkgconfig for XDG config collisions 2021-04-07 10:44:58 +02:00
.zpkgconfig.example rename .config to .zpkgconfig for XDG config collisions 2021-04-07 10:44:58 +02:00
LICENSE Initial commit 2020-02-07 10:55:17 +01:00
Makefile chore: reorganize files 2022-05-06 15:53:11 +02:00
README.md feat: add hooks 2022-02-03 15:14:18 +01:00

zpkg

Basic and simple packaging system

Designed to be used by anyone and deployed anywhere, it is a very basic packaging system with basic functionnality but very portable

Official repo: https://zpkg.zawz.net

As user

Requirements:

  • sudo
  • wget
  • tar
  • xz/gzip

Optional:

  • pixz/pigz (faster compression/decompression)

Installing

wget -qO- https://zpkg.zawz.net/install.sh | sh

By default the config is installed to /etc/zpkg This can be changed with the -c option

If you wish to use another repository, substitute zpkg.zawz.net for your desired target

Uninstalling

zpkg remove $(zpkg list)
sudo rm -r /etc/zpkg

Using

See zpkg -h for details

Deploy on a server

Requirements

To deploy on a server you need:

  • SSH server
  • HTTP server
  • dedicated zpkg user

You need to be able to SSH to the zpkg user, SSH keys are recommended

Process

  1. Clone this repository

  2. Write the desired config in .zpkgconfig, see .zpkgconfig.example

  3. Run make

  4. Expose the package directory to the HTTP server

Package architecture

.
+-- DEPS
+-- DESC
+-- HOOKS
|    +-- pre_install
|    +-- ...
+-- ROOT
|    +-- /
+-- HOME
     +-- ~
  • The ROOT directory represents the root filesystem
  • The HOME directory represents the home directory of the user
  • The DEPS file contains dependency packages separated by spaces or newlines. Dependencies are package names from the repository
  • The DESC file contains the description of the package
  • The HOOKS directory contains hooks to run on certain operations.

Hooks

Hooks are executable files that are run at some points during processing.
Files are named ORDER_OPERATION or ORDER_OPERATION_user, for example: pre_install, post_upgrade_user.
The _user file is executed as user while original is executed as root.

Supported hooks:

  • pre_install
  • post_install
  • pre_upgrade
  • post_upgrade
  • pre_remove
  • post_remove

Suffix with _user to run as user

Deploying packages

zpkg deploy <dir...>

Target directories are structured as described above
The name of the directory is the package name

Updating

git pull && make

Functionality

  • Install/Remove/Update packages
  • Dependency resolution
  • Config redirection
  • User Home package files

Absent (and unplanned) functionality

  • Versions
  • Multi-repo
  • Hooks