summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/pciutils/package.py
blob: 15412649bc44ddb1b7a98cafc47d6a6cfc2f25f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import *


class Pciutils(MakefilePackage):
    """This package contains the PCI Utilities."""

    homepage = "https://mj.ucw.cz/sw/pciutils/"
    url = "https://github.com/pciutils/pciutils/archive/v3.7.0.tar.gz"

    license("GPL-2.0-only")

    version("3.7.0", sha256="ea768aa0187ba349391c6c157445ecc2b42e7d671fc1ce8c53ff5ef513f1e2ab")
    version("3.6.4", sha256="551d0ac33f030868b7e95c29e58dc2b1882455dbc9c15c15adf7086e664131f1")
    version("3.6.3", sha256="7ab0fbb35cffa326eb852539260562bac14f3d27cda8c70bc2cf3211ed97c014")

    variant("lib", default=False, description="Install libraries with headers")

    def build(self, spec, prefix):
        make("PREFIX={0}".format(prefix))

    def install(self, spec, prefix):
        if "+lib" in spec:
            make("install-lib", "install", "PREFIX={0}".format(prefix))
        else:
            make("install", "PREFIX={0}".format(prefix))

    def setup_run_environment(self, env):
        env.prepend_path("PATH", self.prefix.sbin)