Alrin (Arch Linux repository for ivasilev.net) is a bunch of code that grew out of me managing my pacman/ALPM repository.
In short, this tool needs a repository for managing state, say alrin-state, determined by the ALRIN_STATE_REPO environment variable or the working directory as a fallback. Packages with PKGBUILD/.SRCINFO files are stored as git submodules in alrin-state/pkgbuild, which allows easily checking for updates by simply pulling. Viat is used to store versions and some other metadata --- see below.
The builds use makechrootpkg and the resulting files are put in the alrin-state/pkgdest directory, along with the package databases.
Note
It is likely that every person managing a pacman repository has needs different from mine. If you find this tool useful, you can always contact me or open a pull request with whatever changes you need.
To use alrin without cloning the repository, you can utilize pipx:
pipx install git+https://github.com/v--/alrinA new state repository can be initialized by running a variation of
mkdir $ALRIN_STATE_REPO
cp --recursive viat_sample $ALRIN_STATE_REPO/.viat
cd $ALRIN_STATE_REPO
git initYou can optionally copy or symlink a pacman.conf file in $ALRIN_STATE_REPO and it will get synchronized before very build.
The following can then register <package> from the AUR:
alrin pkg add <package>The following updates all packages:
alrin bulk updateThe tricky job of removing a git submodule, along with the associated build files and Viat metadata, can be done by
alrin pkg remove <package>There are two more commands --- see below.
The following is an excerpt from .viat/store.toml in my personal state repository:
["pkgbuild/dpsprep"]
pkgver = "2.6.4"
pkgrel = "3.314"
builddate = 1781369820If modified during the build, pkgver, pkgrel and buliddate attributes are set after each pkg update <package> or bulk-update. The builddate is reused as SOURCE_DATE_EPOCH if running pkg rebuild <package> (if a reproducible package needs to be recreated for whatever reason; note that .BUILDINFO will differ the package's dependencies are updated).
For Python packages, whose installation directory depends on the version of Python, a custom suffix can be automatically added to pkgrel, like so (see this thread for details):
["pkgbuild/python-djvulibre-python"]
pkgver = "0.9.3"
pkgrel = "3.314"
add_python_suffix = true
builddate = 1783420854Finally, consider the following example:
["pkgbuild/mkinitcpio-growrootfs"]
git_root = "ec2-packages"
pkgver = "2.1"
pkgrel = "1"
builddate = 1781374235Here, pkgbuild/mkinitcpio-growrootfs is a symlink to ../ec2-packages/mkinitcpio-growrootfs, where ec2-packages is this repository. The role of the git_root attribute should be obvious.
Alrin creates a custom keyring at $ALRIN_STATE_REPO/keyring that is used during the build. It can be managed via
GNUPGHOME=$ALRIN_STATE_REPO/keyring gpg ...This directory is intended to be ignored by version control. The $ALRIN_STATE_REPO/keyring_backup.asc file can be used to backup and restore its public keys via
alrin keyring backupand
alrin keyring restore