Set up Alpine Linux packaging environment with a breeze! See this blog post.
alpkg
is a tool for all your Alpine packaging needs. It can create a chroot with preinstalled tools in a matter of seconds, set up aports repository, and fetch/update packages. Most importantly, it provides a split layout via Zellij for easy editing/building APKBUILD
files.
Usage: alpkg [init|edit|fetch|update] [<package>]
Commands:
init Initialize an Alpine chroot.
edit <package> Edit or create a package.
fetch <package> Fetch an existing package from the remote repository.
update <package> Update the package on the remote repository.
destroy Remove the chroot and repository.
Options:
--packager "Your Name <your@email.address>" The name and email address of the package maintainer.
--aports "https://gitlab.alpinelinux.org/<user>/aports" The URL of the remote APorts repository.
Environment variables:
CHROOT_DIR Directory for Alpine chroot. (default: /alpine)
APORTS_DIR Directory for remote APorts repository. (default: /home/user/aports)
PACKAGE_DIR Directory for APK packages built and stored. (default: /home/user/apkbuilds in chroot)
To create an Alpine Linux chroot and initialize aports repository for packaging, simply run:
alpkg init --packager "Your Name <your@email.address>" --aports "https://gitlab.alpinelinux.org/<user>/aports"
It is possible to pass options to alpine-chroot-install
via environment variables.
* You need to create an account on https://gitlab.alpinelinux.org and fork the aports repository under your user.
* If you run alpkg init
in your $HOME
directory, the Alpine working directory will point to $HOME/apkbuilds
.
To create a new APKBUILD
, you can use the edit
command. Note that it uses newapkbuild
under the hood so you can pass newapkbuild
options to it:
alpkg edit <newapkbuild_opts> <package_name>
For example:
alpkg edit -r -d "A highly customizable changelog generator" -l "GPL-3.0-only" -u "https://github.com/orhun/git-cliff" git-cliff
Or you can generate an empty package with the following command:
alpkg edit testpkg
If the package already exists, you can also use edit
command to edit the contents of the APKBUILD
.
To fetch existing packages from aports
and edit them:
alpkg fetch <package_name>
To commit the changes to the aports
repository:
alpkg update <package_name>
This project is licensed under The MIT License.
Copyright © 2023, Orhun Parmaksız