After researching for examples on Alpine Linux repositories and carefully reading the APKBUILD reference on the Alpine's official wiki, i've managed to create my own APKBUILD
that simply copies two static files to /usr/bin
# Maintainer: henriquehbr <henriqueborgeshbr@gmail.com>
pkgname=alpine.sh
pkgver=0.1.0
pkgrel=1
pkgdesc="An answerfile and automated post-install script for Alpine Linux"
url="https://git.sr.ht/~henriquehbr/alpine.sh"
arch="all"
license="GPL-3.0-or-later"
source="answerfile post-install"
options="!check"
package() {
installation_path="$pkgdir"/usr/bin
mkdir -p "$installation_path"
cp -f post-install "$installation_path"
cp -f answerfile "$installation_path"
chmod 755 "$installation_path"/post-install
}
Both the answerfile
and post-install
script are on the same directory of the APKBUILD
In order to build an .apk
for it, it's required to generate the checksums by running:
abuild checksum
And then build it with:
abuild -r
An .apk
file of your package will be created at $HOME/packages/$USER/x86_64/$pkgname-$pkgver.apk
, this path might vary depending on your settings/system, and also, i used the x86_64
architecture here as an example