# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fuse
pkgver=2.9.9
pkgrel=5
pkgdesc="A library that makes it possible to implement a filesystem in a userspace program."
url="https://github.com/libfuse/libfuse/"
arch="all"
license="GPL-2.0-only AND LGPL-2.1-only"
options="suid !check" # No test suite
depends="fuse-common"
makedepends="gettext-dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://github.com/libfuse/libfuse/releases/download/fuse-$pkgver/fuse-$pkgver.tar.gz
	fix-realpath.patch
	"

# secfixes:
#   2.9.8-r0:
#     - CVE-2018-10906

prepare() {
 	default_prepare
	update_config_sub
}

build() {
	UDEV_RULES_PATH='/lib/udev/rules.d' ./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-static \
		--enable-shared \
		--disable-example \
		--enable-lib \
		--enable-util \
		--bindir=/bin
	make
}

package() {
	make DESTDIR="$pkgdir" install
	rm -r "$pkgdir"/dev "$pkgdir"/etc/init.d
}

sha512sums="3d82fafd04f2924299bb09d2bb144935fa004a43fb9a6568e2e1cc5a60fded2efa1711029a0d7f12b3e6e4501f7217f2ee3545646d89da8dece083cb390f23e2  fuse-2.9.9.tar.gz
6f2234d3a049f9df6d2dfa00c962239f4684ba0c3a4931d697bde5a250795e0a4b057c9342f4668cd81a855222814fbe49a99b5a1274199d37599d59543eff5c  fix-realpath.patch"
