aports/testing/apk-tools3/APKBUILD

104 lines
3 KiB
Text

# Maintainer: Sertonix <sertonix@posteo.net>
pkgname=apk-tools3
pkgver=3.0.0_rc4_git20250320
_commit=3abcd400bdbfc61a2f53f7cf7b240130169154b2
pkgrel=0
pkgdesc="Alpine Package Keeper v3 - package manager for alpine"
arch="all"
url="https://git.alpinelinux.org/apk-tools"
license="GPL-2.0-only"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-static $pkgname-doc libapk3:libapk"
depends="musl>=1.2.3_git20230424"
depends_doc="!apk-tools-doc"
_lua="5.3"
makedepends_build="meson openssl>3 lua$_lua lua$_lua-lzlib scdoc"
makedepends_host="zlib-dev zstd-dev openssl-dev zlib-static zstd-static openssl-libs-static linux-headers"
checkdepends="cmocka-dev"
if [ -z "$BOOTSTRAP" ]; then
subpackages="$subpackages lua$_lua-apk3:luaapk py3-apk3:pyapk"
makedepends_host="$makedepends_host lua$_lua-dev python3-dev"
# ca-certificates-bundle needed for https certificate validation
depends="$depends ca-certificates-bundle"
fi
source="https://gitlab.alpinelinux.org/alpine/apk-tools/-/archive/$_commit/apk-tools-v$pkgver.tar.gz"
builddir=$srcdir/apk-tools-$_commit
# Allow apk3 to be installed as system-wide apk.
# We provide apk-tools version 2.10 in order to encourage the solver to
# use apk2 in main for now.
provides="apk-tools=2.10"
build() {
export VERSION=$pkgver-r$pkgrel
abuild-meson \
--auto-features=disabled \
--bindir=/sbin \
-Darch="$CARCH" \
-Ddocs=enabled \
-Dhelp=enabled \
-Dlua_version=$_lua \
-Dlua="$([ -z "$BOOTSTRAP" ] && echo enabled || echo disabled)" \
-Dpython="$([ -z "$BOOTSTRAP" ] && echo enabled || echo disabled)" \
-Dtests="$(want_check && echo enabled || echo disabled)" \
output
ninja -C output
abuild-meson \
--auto-features=disabled \
-Darch="$CARCH" \
-Dc_link_args="$CFLAGS -static" \
-Ddefault_library=static \
-Dprefer_static=true \
output-static
ninja -C output-static src/apk
}
check() {
meson test --no-rebuild --print-errorlogs -C output
}
package() {
DESTDIR="$pkgdir" meson install --no-rebuild -C output
install -d "$pkgdir"/lib/apk/db \
"$pkgdir"/lib/apk/exec \
"$pkgdir"/etc/apk/keys \
"$pkgdir"/etc/apk/protected_paths.d
}
libapk() {
amove usr/lib/libapk.so.*
}
static() {
pkgdesc="$pkgdesc (static binary)"
depends=""
install -Dm755 "$builddir"/output-static/src/apk "$subpkgdir"/sbin/apk.static
${CROSS_COMPILE}strip "$subpkgdir"/sbin/apk.static
local pubkey="${PACKAGER_PUBKEY:-$PACKAGER_PRIVKEY.pub}"
openssl dgst -sha1 -sign "$PACKAGER_PRIVKEY" \
-out "$subpkgdir"/sbin/apk.static.SIGN.RSA."${pubkey##*/}" \
"$subpkgdir"/sbin/apk.static
openssl dgst -sha256 -sign "$PACKAGER_PRIVKEY" \
-out "$subpkgdir"/sbin/apk.static.SIGN.RSA.sha256."${pubkey##*/}" \
"$subpkgdir"/sbin/apk.static
}
luaapk() {
pkgdesc="Lua module for $pkgname"
depends="!${subpkgname%3}"
amove usr/lib/lua
}
pyapk() {
pkgdesc="Python module for $pkgname"
depends=""
amove usr/lib/python\*
}
sha512sums="
67a4e03094205fc209db04fd4774151c140056124e305e313dd28444320616f09797567562d1c3da14754b16ccb942e94b808bb63a8d0d3fd4af26e5d2ec81d8 apk-tools-v3.0.0_rc4_git20250320.tar.gz
"