pkgname=fuse
pkgver=3.17.4
pkgdesc='Interface for userspace programs to export a filesystem to the Linux kernel'
homepage='https://github.com/libfuse/libfuse'
arch=('x86_64')
license=('GPL2')
makedepends=('pkg-config' 'meson' 'udev')
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://github.com/libfuse/libfuse/releases/download/${pkgname}-${pkgver}/${sources[0]}")
sha512sums=("5451b374ceadb4cb5a8f0c396f1111932ec63984b80dfad7a76258c026b4e8e5ab4a563bb4a9e272d7fa62a5f452113885d4c3ea080a9f56b6aeb85d50c01010")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  local meson_args=(
    --prefix=/usr
    --buildtype=release
    --wrap-mode=nodownload
    -D python.bytecompile=1
    -D examples=false
    -D tests=false
    -D useroot=false
    -D initscriptdir=
    -D udevrulesdir="/usr/lib/udev/rules.d"
  )
  meson setup build "${meson_args[@]}"
  meson compile -C build
}

src_install() {
  meson install -C build --destdir "$pkgdir"
  chmod -v u+s "${pkgdir}"/usr/bin/fusermount3
}

# vim:ft=sh syn=sh et sw=2:
