A few minimal test packages, fodder for testing 'spack view' command.
This commit is contained in:
parent
346f102234
commit
26c5bc9d97
8 changed files with 123 additions and 0 deletions
29
var/spack/repos/builtin.mock/packages/test-a/package.py
Normal file
29
var/spack/repos/builtin.mock/packages/test-a/package.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
from spack import *
|
||||
|
||||
import os
|
||||
|
||||
mydir = os.path.dirname(__file__)
|
||||
source = os.path.join(mydir,'test-a-0.0.tar.gz')
|
||||
|
||||
class TestA(Package):
|
||||
"""The test-a package"""
|
||||
|
||||
url = 'file://'+source
|
||||
|
||||
version('0.0', '4e823d0af4154fcf52b75dad41b7fd63')
|
||||
|
||||
variant('nom', default=True, description='Nominal variant')
|
||||
variant('var', default=False, description='Variant variant')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
bindir = os.path.join(prefix,'bin')
|
||||
os.makedirs(bindir)
|
||||
script = os.path.join(bindir, 'test-a')
|
||||
with open(script,'w') as fp:
|
||||
fp.write("""#!/bin/bash
|
||||
echo 'name: %s'
|
||||
echo 'prefix: %s'
|
||||
echo 'spec: %s'
|
||||
""" % (spec.name, prefix, spec))
|
||||
|
||||
os.chmod(script, 0555)
|
BIN
var/spack/repos/builtin.mock/packages/test-a/test-a-0.0.tar.gz
Normal file
BIN
var/spack/repos/builtin.mock/packages/test-a/test-a-0.0.tar.gz
Normal file
Binary file not shown.
31
var/spack/repos/builtin.mock/packages/test-b/package.py
Normal file
31
var/spack/repos/builtin.mock/packages/test-b/package.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
from spack import *
|
||||
|
||||
import os
|
||||
|
||||
mydir = os.path.dirname(__file__)
|
||||
source = os.path.join(mydir,'test-b-0.0.tar.gz')
|
||||
|
||||
class TestB(Package):
|
||||
"""The test-b package"""
|
||||
|
||||
url = 'file://'+source
|
||||
|
||||
version('0.0', '4e823d0af4154fcf52b75dad41b7fd63')
|
||||
|
||||
variant('nom', default=True, description='Nominal variant')
|
||||
variant('var', default=False, description='Variant variant')
|
||||
|
||||
depends_on('test-a')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
bindir = os.path.join(prefix,'bin')
|
||||
os.makedirs(bindir)
|
||||
script = os.path.join(bindir, 'test-b')
|
||||
with open(script,'w') as fp:
|
||||
fp.write("""#!/bin/bash
|
||||
echo 'name: %s'
|
||||
echo 'prefix: %s'
|
||||
echo 'spec: %s'
|
||||
""" % (spec.name, prefix, spec))
|
||||
|
||||
os.chmod(script, 0555)
|
BIN
var/spack/repos/builtin.mock/packages/test-b/test-b-0.0.tar.gz
Normal file
BIN
var/spack/repos/builtin.mock/packages/test-b/test-b-0.0.tar.gz
Normal file
Binary file not shown.
31
var/spack/repos/builtin.mock/packages/test-c/package.py
Normal file
31
var/spack/repos/builtin.mock/packages/test-c/package.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
from spack import *
|
||||
|
||||
import os
|
||||
|
||||
mydir = os.path.dirname(__file__)
|
||||
source = os.path.join(mydir,'test-c-0.0.tar.gz')
|
||||
|
||||
class TestC(Package):
|
||||
"""The test-c package"""
|
||||
|
||||
url = 'file://'+source
|
||||
|
||||
version('0.0', '4e823d0af4154fcf52b75dad41b7fd63')
|
||||
|
||||
variant('nom', default=True, description='Nominal variant')
|
||||
variant('var', default=False, description='Variant variant')
|
||||
|
||||
depends_on('test-a+var',when='+var')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
bindir = os.path.join(prefix,'bin')
|
||||
os.makedirs(bindir)
|
||||
script = os.path.join(bindir, 'test-c')
|
||||
with open(script,'w') as fp:
|
||||
fp.write("""#!/bin/bash
|
||||
echo 'name: %s'
|
||||
echo 'prefix: %s'
|
||||
echo 'spec: %s'
|
||||
""" % (spec.name, prefix, spec))
|
||||
|
||||
os.chmod(script, 0555)
|
BIN
var/spack/repos/builtin.mock/packages/test-c/test-c-0.0.tar.gz
Normal file
BIN
var/spack/repos/builtin.mock/packages/test-c/test-c-0.0.tar.gz
Normal file
Binary file not shown.
32
var/spack/repos/builtin.mock/packages/test-d/package.py
Normal file
32
var/spack/repos/builtin.mock/packages/test-d/package.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
from spack import *
|
||||
|
||||
import os
|
||||
|
||||
mydir = os.path.dirname(__file__)
|
||||
source = os.path.join(mydir,'test-d-0.0.tar.gz')
|
||||
|
||||
class TestD(Package):
|
||||
"""The test-d package"""
|
||||
|
||||
url = 'file://'+source
|
||||
|
||||
version('0.0', '4e823d0af4154fcf52b75dad41b7fd63')
|
||||
|
||||
variant('nom', default=True, description='Nominal variant')
|
||||
variant('var', default=False, description='Variant variant')
|
||||
|
||||
depends_on('test-b')
|
||||
depends_on('test-c')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
bindir = os.path.join(prefix,'bin')
|
||||
os.makedirs(bindir)
|
||||
script = os.path.join(bindir, 'test-d')
|
||||
with open(script,'w') as fp:
|
||||
fp.write("""#!/bin/bash
|
||||
echo 'name: %s'
|
||||
echo 'prefix: %s'
|
||||
echo 'spec: %s'
|
||||
""" % (spec.name, prefix, spec))
|
||||
|
||||
os.chmod(script, 0555)
|
BIN
var/spack/repos/builtin.mock/packages/test-d/test-d-0.0.tar.gz
Normal file
BIN
var/spack/repos/builtin.mock/packages/test-d/test-d-0.0.tar.gz
Normal file
Binary file not shown.
Loading…
Reference in a new issue