summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/hash-test2/package.py
blob: 773370e5a197aa60ef2a77dbcefc3b2c6e1a4e5b (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
# Copyright 2013-2024 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)

import os

from spack.package import *


class HashTest2(Package):
    """Used to test package hashing"""

    homepage = "http://www.hashtest2.org"
    url = "http://www.hashtest1.org/downloads/hashtest2-1.1.tar.bz2"

    version("1.1", md5="a" * 32)
    version("1.2", md5="b" * 32)
    version("1.3", md5="c" * 31 + "x")  # Source hash differs from hash-test1@1.3
    version("1.4", md5="d" * 32)

    patch("patch1.patch", when="@1.1")

    variant("variantx", default=False, description="Test variant X")
    variant("varianty", default=False, description="Test variant Y")

    def setup_dependent_build_environment(self, env, dependent_spec):
        pass

    def install(self, spec, prefix):
        print("install 1")
        os.listdir(os.getcwd())

        # sanity_check_prefix requires something in the install directory
        mkdirp(prefix.bin)