librelic

license-badge build codecov crates.io Minimum rustc

Package management library for the Arch Linux packaging ecosystem

Quick links

Usage

Requires rustc >= 1.42

This minimum rustc requirement is driven by the tracing_subscriber requirements

Research

Collecting the research done while developing this project here.

References: * Arch Build System * Pacman * Pacman source * Package Management Rosetta Stone

Arch build system (ABS)

The Arch build system (ABS) packages all the software for the Arch Linux ecosystem and consists of the following tools:

ABS repository tree

Each package has its own subdirectory containing repos and trunk directories: * repos contains the official arch linux repo configuration * trunk is used for latest development still being tested before being promoted to repos

Exmple: acl acl/repos acl/repos/core-x86_64 acl/repos/core-x86_64/PKGBUILD acl/trunk acl/trunk/PKGBUILD

asp package

The asp package is just a thin wrapper around the svntogit repositories.

To clone the git repository for a specific package use: bash $ asp checkout <pkg-name>

To update the cloned repo run: bash $ asp update; git pull

Build container

Building in a clean chroot prevents missing dependencies in packages and allows for a separation from your current system. The best way to do this is to use a container to build in.

Pacman

The pacman package manager combines a simple binary package format with an easy-to-use build system. pacman internally uses the libalpm library for interacting with the package databases.

Arch Linux Package Management (ALPM)

Arch Linux's package management depends on the Arch Linux Package Management (ALPM) library libalpm for all of its automation.

ALPM Public Interface

pacman and libalpm are written in C and share the same git repo. alpm.h and alpm_list.h constitute the sum of all structures, data and functions declared available to the frontend i.e. pacman. pacman provides a facade to the library. All the library internal functions are prefixed with _alpm_ while the public functions are prefixed wih alpm_.

alpm databases

alpm hooks

alpm hooks provide the ability to specify scripts to run before or after transactions based on the packages and/or files being modified. Hooks condist of a single Action section describing the action to be run and one or more Trigger sections describing which tranactions it should run.

Hooks are read from files located in the system hook directory /usr/local/share/libalpm/hooks and additional custom directories specified in pacman.conf which defaults to /usr/local/share/etc/pacman.d/hooks. File names are required to have the suffix .hook. Hooks are run in alphabetical order of their file names.

alpm interface

alpm list

alpm log

alpm misc

alpm packages

alpm sync

alpm trans

Contribute

Pull requests are always welcome. However understand that they will be evaluated purely on whether or not the change fits with my goals/ideals for the project.

Git-Hook

Enable the git hooks to have automatic version increments bash cd ~/Projects/relic git config core.hooksPath .githooks

License

This project is licensed under either of: * MIT license LICENSE-MIT or http://opensource.org/licenses/MIT * Apache License, Version 2.0 LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


Backlog

Changelog