summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/xfsdump/package.py
blob: 0a9145bd029756bb0bf8805097dbb8b6b7ae4518 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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 Xfsdump(MakefilePackage):
    """XFS Dump Tools."""

    homepage = "https://github.com/pcacjr/xfsdump"
    url = "https://github.com/pcacjr/xfsdump/archive/v3.1.6.tar.gz"

    version("3.1.6", sha256="bbf659758107cad9b41cf3001df121e6428485b341109a1f1a952fd477a7010b")
    version("3.1.5", sha256="ba5bb91413ccb5a0eaffaa84f242baa08520a09f7b990b28bbd0d33a4390f7b6")
    version("3.1.4", sha256="a75d5c7dabd3dd4184008efcfd30d0c96b6ab318edaad9659ce180dfb9652b01")

    depends_on("gettext")
    depends_on("autoconf", type="build")
    depends_on("automake", type="build")
    depends_on("libtool", type="build")
    depends_on("m4", type="build")
    depends_on("util-linux")
    depends_on("attr")
    depends_on("xfsprogs@:4.20.0")

    def flag_handler(self, name, flags):
        if name == "ldlibs" and "intl" in self.spec["gettext"].libs.names:
            flags.append("-lintl")
        return env_flags(name, flags)

    def build(self, spec, prefix):
        make(
            "prefix={0}".format(self.prefix),
            "MSGFMT={0}".format(self.spec["gettext"].prefix.bin.msgfmt),
            "MSGMERGE={0}".format(self.spec["gettext"].prefix.bin.msgmerge),
            "XGETTEXT={0}".format(self.spec["gettext"].prefix.bin.xgettext),
        )

    def install(self, spec, prefix):
        make(
            "prefix={0}".format(self.prefix),
            "MSGFMT={0}".format(self.spec["gettext"].prefix.bin.msgfmt),
            "MSGMERGE={0}".format(self.spec["gettext"].prefix.bin.msgmerge),
            "XGETTEXT={0}".format(self.spec["gettext"].prefix.bin.xgettext),
            "install",
        )

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