From 17bc93708300785a360f8e4615d3550dcb400cd6 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 16 May 2022 21:01:44 +0200 Subject: libfuse: add utils variant (#30675) By default, libfuse install helper programs like `fusermount3`, which are mostly useless if not installed with setuid (that is, `+useroot`). However, their presence makes it complicated to use globally installed versions, which can be combined with a Spack-installed FUSE library. In particular, on systems that have a setuid fusermount3 binary, but no libfuse-dev installed, it is nice to be able to build libfuse with Spack, and have it call the system setuid executable. --- var/spack/repos/builtin/packages/libfuse/package.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/libfuse/package.py b/var/spack/repos/builtin/packages/libfuse/package.py index 5790b46cf8..a8242f97d2 100644 --- a/var/spack/repos/builtin/packages/libfuse/package.py +++ b/var/spack/repos/builtin/packages/libfuse/package.py @@ -32,11 +32,12 @@ class Libfuse(MesonPackage): return "https://github.com/libfuse/libfuse/releases/download/fuse-{0}/fuse-{1}.tar.gz".format(version, version) return "https://github.com/libfuse/libfuse/archive/refs/tags/fuse-{0}.tar.gz".format(version) - variant('useroot', default=False, description="Use root privileges to make fusermount a setuid binary after installation") - variant('system_install', default=False, description=( + variant('useroot', when='+utils', default=False, description="Use root privileges to make fusermount a setuid binary after installation") + variant('system_install', when='+utils', default=False, description=( "Do not run the post-install script " "which typically sets up udev rules and " "and init script in /etc/init.d")) + variant('utils', default=True, description='Build and install helper and example programs.') depends_on('autoconf', type='build', when='@:2') depends_on('automake', type='build', when='@:2') @@ -67,6 +68,13 @@ class Libfuse(MesonPackage): def meson_args(self): args = [] + if '+utils' in self.spec: + args.append('-Dutils=true') + args.append('-Dexamples=true') + else: + args.append('-Dutils=false') + args.append('-Dexamples=false') + if '+useroot' in self.spec: args.append('-Duseroot=true') else: -- cgit v1.2.3-70-g09d2