cgdcbxd: Fix build: Use DESTDIR=self.prefix to not write to /etc (#26145)

Fix the build for normal non-root/non-system-user builds, as we cannot
know that we'd have to uninstall these files even if installed as root.
Also add `pkgconfig` and remove not explicitly needed `depends_on('m4')`
This commit is contained in:
bernhardkaindl 2021-09-25 00:32:09 +02:00 committed by GitHub
parent ab90cd8fc4
commit 8d70f94aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,10 +20,17 @@ class Cgdcbxd(AutotoolsPackage):
depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('m4', type='build')
depends_on('pkgconfig', type='build')
depends_on('libcgroup@0.32:')
depends_on('libmnl')
def autoreconf(self, spec, prefix):
bash = which('bash')
bash('./bootstrap.sh')
@property
def install_targets(self):
# Without DESTDIR=self.prefix, an attempt would be made to install
# configuration files to /etc, which would faild the build and even
# when privileges for this exist, spack could not remove it on uninstall:
return ['install', 'DESTDIR={0}'.format(self.prefix)]