# Contributor: Hoang Nguyen <folliekazetani@protonmail.com>
# Maintainer: omni <omni+alpine@hack.org>
maintainer="omni <omni+alpine@hack.org>"
pkgname=passt
pkgver=2025.05.12
_commit=8ec1341
_tag=${pkgver//./_}.$_commit
pkgrel=0
pkgdesc="Plug A Simple Socket Transport"
url="https://passt.top/"
# ppc6le: may fail in CI with the message:
#   Failed to close files leaked by parent: Function not implemented
# but should pass on the ppc64le package builder, see 2024-09-12 12:
#   https://irclogs.alpinelinux.org/%23alpine-devel-2024-09.log
arch="all"
license="BSD-3-Clause AND GPL-2.0-or-later"
makedepends="coreutils-fmt linux-headers"
subpackages="$pkgname-doc"
source="https://passt.top/passt/snapshot/passt-$_tag.tar.gz"
builddir="$srcdir/$pkgname-$_tag"

build() {
	make VERSION="$_tag"
}

check() {
	# complicated test setup, requires qemu and a lot of VM images
	# let's just at least do this
	./passt --version
	./pasta --version
}

package() {
	make DESTDIR="$pkgdir" prefix=/usr install
	install -Dm644 LICENSES/*.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
6ef15f98378cc75d70bf56d8334ad680e36868b503e86ea70fde679135b20f31eb3f1434917564f61cc440c3aa05aa5e104143f1a812cf4eb86c87758b42dc0e  passt-2025_05_12.8ec1341.tar.gz
"
