- This Gist covers the commands and methods needed to create APK files and a local repository on Alpine Linux for your own software packages.
- The focus of this guide is toward interpereted language software packages that do not require compiling, and is a simplified overview of what is needed to build a package.
- Written by: XtendedGreg and featured on the live stream https://youtube.com/live/Q0XAnXgCxIw
apk add alpine-sdk sudo abuild-rootbld doas
adduser [username]
addgroup [username] abuild
addgroup [username] wheel
lbu add /home/[username]
mkdir -p /var/cache/distfiles
chgrp abuild /var/cache/distfiles
chmod g+w /var/cache/distfiles
lbu add /var/cache/distfiles
su [username]
git config --global user.name "Your Full Name"
git config --global user.email "your@email.address"
abuild-keygen -a -i
cp /home/[username]/.abuild/*.rsa.pub /etc/apk/keys
This will create the directory and copy the example conf, init and install file to the directory.
mkdir -p ~/dev/testing/[package name]
cd ~/dev/testing/[package name]
newapkbuild -c [package name]
Update the file to definitely include pkgname, pkgver, pkgdesc, url, license, depends and source.
- Add and edit whatever files you need to complete your program and then add them to the source entry in APKBUILD.
- You may want to create a directory called
root
inside the package folder that contains the files that you need in the correct relative locations to their final installed locations and then include that path in the source entry in APKBUILD.
cd ~/dev/testing/[package name]
abuild checksum
abuild -r
echo /home/[username]/packages/testing/ >> /etc/apk/repositories
echo /home/[username]/packages/main/ >> /etc/apk/repositories
echo /home/[username]/packages/community/ >> /etc/apk/repositories
apk update
apk add [package name]
lbu commit -d
- https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package
- https://spdx.org/licenses/
- https://wiki.alpinelinux.org/wiki/APKBUILD_Reference
- This gist has not yet been tested from scratch to confirm viability and this note will be removed once it has.