# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=lxcfs
pkgver=6.0.1
pkgrel=0
pkgdesc="FUSE filesystem for LXC"
url="https://linuxcontainers.org/lxcfs"
arch="all"
license="Apache-2.0"
depends="shadow-subids uidmapshift"
makedepends="meson fuse3-dev linux-headers help2man py3-jinja2"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://linuxcontainers.org/downloads/lxcfs/lxcfs-$pkgver.tar.gz
	lxcfs.confd
	lxcfs.initd
	README.alpine
	fix-undeclared-path-max.patch
	"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dinit-script=[] \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
	install -m644 -D "$srcdir"/README.alpine \
		"$pkgdir"/usr/share/doc/lxcfs/README.alpine
}

sha512sums="
3e5ab8af0fd81b1b0ac83ce781b20a55c1c1277a01edbca07106534043a0070291331775b7fa4e1c005b54d24d690ad9abe9b208de749a70dcff853741d02fd4  lxcfs-6.0.1.tar.gz
71df316b1aaf1a0fadc230473a66c0be4d201d706481f1042c353b79fc629e9e681ec4fe0dfb113370e00d3f40175b0d7759fdcdcce57cf1d2db585068aa6e8d  lxcfs.confd
294424f5ee4c64659c3079fb9caf7310523acdda18f93fcffcf99f2b624fe008236919b6acaea5e5881499ec26a7fd893e9e3bb2b9c5abbf491ead08a2223d3f  lxcfs.initd
16c65a10b2b95a85ea21d2cb44a45c9c7faf1e22c8c438c7325be96025588834a528544598a91facc13fa93cc46f6c4534fa2ca6bb58b152a26f1ced94b18f16  README.alpine
8b9510d14195c9c4cb0d87c5183263bcdbf424e5ba769d07ea896f5af93d7bcc11d4e8e960de7cb971b6bd1cae932850ebe8e0d3b0176acd270cab5030313f7b  fix-undeclared-path-max.patch
"
