# Contributor: Hoang Nguyen <folliekazetani@protonmail.com>
# Maintainer: omni <omni+alpine@hack.org>
maintainer="omni <omni+alpine@hack.org>"
pkgname=passt
pkgver=2025.01.21
_commit=4f2c8e7
_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="
96f0794d0ec5a2e7a1f994b322fa4e2079e7356d3e1b553a83c72a05ffe77a25de936f5f987eec7a4b28c394dd6315878d6be7638a367c58c77919d1d21a1d50  passt-2025_01_21.4f2c8e7.tar.gz
"
