pmaports/main/postmarketos-mkinitfs/APKBUILD
Oliver Smith d757a36882
main/postmarketos-mkinitfs: fix trigger script (MR 4422)
Adjust the trigger script to only check for the new deviceinfo path. The
purpose of this check is to make sure that a full device package is
installed, and only in that case run mkinitfs. Otherwise, it will fail
because e.g. no kernels may be installed.

With recent changes, /etc/deviceinfo is a part of devicepkg-utils and
only /usr/share/deviceinfo/deviceinfo really indicates that a device
package is installed.

Remove the "exit 0" at the end while at it, it did not do anything since
the script runs with "/bin/sh -e". Add a comment to make this clear.

[ci:skip-build]: already built successfully in CI
2023-09-26 08:31:00 +02:00

55 lines
1.8 KiB
Text

# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-mkinitfs
pkgver=2.2.1
pkgrel=2
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
depends="
boot-deploy>=0.9
"
makedepends="go scdoc"
replaces="mkinitfs"
triggers="$pkgname.trigger=/usr/share/mkinitfs/*:/usr/share/kernel/*:/usr/share/mkinitfs-triggers:/usr/share/deviceinfo"
# mkinitfs-vendor-$pkgver.tar.gz: vendored Go deps, is part of the release:
# https://gitlab.com/postmarketOS/postmarketos-mkinitfs/-/releases
source="
https://gitlab.com/postmarketOS/postmarketos-mkinitfs/-/archive/$pkgver/postmarketos-mkinitfs-$pkgver.tar.gz
https://gitlab.com/api/v4/projects/postmarketOS%2Fpostmarketos-mkinitfs/packages/generic/mkinitfs-vendor-$pkgver/$pkgver/mkinitfs-vendor-$pkgver.tar.gz
"
install="$pkgname.post-upgrade"
arch="all"
license="GPL-2.0-or-later"
provider_priority=999 # higher priority than Alpine's mkinitfs
provides="initramfs-generator"
subpackages="$pkgname-doc"
export CGO_ENABLED=0
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
export GOPATH="$srcdir"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
prepare() {
default_prepare
ln -s "$srcdir"/vendor "$builddir"/vendor
}
build() {
unset LDFLAGS # passed to Go as linker flags, which are invalid
make VERSION="$pkgver"
}
package() {
make PREFIX=/usr DESTDIR="$pkgdir" install
}
check() {
go test ./...
}
sha512sums="
67a80c3bded6f92ac1c1ac2a0db00b06d9c6799bb7858692b634ee57e860fe871e5bfd7b3d14eaf179c206b36eec7adb69fd252931992ae75348a4c12210d252 postmarketos-mkinitfs-2.2.1.tar.gz
d9e3011d5a6af182c7e79ae6a5dca8abe3590b0132410a09f681fdefd8621ecfe6d0d795772f09a998a444ce8cb9a1f1792ea64fe75db3dbbaf641076249d4e5 mkinitfs-vendor-2.2.1.tar.gz
"