From 26c5bc9d979b95df560bdb7d7a6bd747ef93f83d Mon Sep 17 00:00:00 2001 From: Brett Viren Date: Sun, 1 May 2016 17:10:32 -0400 Subject: [PATCH] A few minimal test packages, fodder for testing 'spack view' command. --- .../builtin.mock/packages/test-a/package.py | 29 ++++++++++++++++ .../packages/test-a/test-a-0.0.tar.gz | Bin 0 -> 112 bytes .../builtin.mock/packages/test-b/package.py | 31 +++++++++++++++++ .../packages/test-b/test-b-0.0.tar.gz | Bin 0 -> 112 bytes .../builtin.mock/packages/test-c/package.py | 31 +++++++++++++++++ .../packages/test-c/test-c-0.0.tar.gz | Bin 0 -> 112 bytes .../builtin.mock/packages/test-d/package.py | 32 ++++++++++++++++++ .../packages/test-d/test-d-0.0.tar.gz | Bin 0 -> 112 bytes 8 files changed, 123 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/test-a/package.py create mode 100644 var/spack/repos/builtin.mock/packages/test-a/test-a-0.0.tar.gz create mode 100644 var/spack/repos/builtin.mock/packages/test-b/package.py create mode 100644 var/spack/repos/builtin.mock/packages/test-b/test-b-0.0.tar.gz create mode 100644 var/spack/repos/builtin.mock/packages/test-c/package.py create mode 100644 var/spack/repos/builtin.mock/packages/test-c/test-c-0.0.tar.gz create mode 100644 var/spack/repos/builtin.mock/packages/test-d/package.py create mode 100644 var/spack/repos/builtin.mock/packages/test-d/test-d-0.0.tar.gz diff --git a/var/spack/repos/builtin.mock/packages/test-a/package.py b/var/spack/repos/builtin.mock/packages/test-a/package.py new file mode 100644 index 0000000000..2f72370580 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/test-a/package.py @@ -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) diff --git a/var/spack/repos/builtin.mock/packages/test-a/test-a-0.0.tar.gz b/var/spack/repos/builtin.mock/packages/test-a/test-a-0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3588e05765cd799dfe19e1f77e057bf7508ec47e GIT binary patch literal 112 zcmb2|=3uzVq!!M={Pvt8-ysJPmJ7D0<~95|Kkb{1f}-PrX$3W18BI)~SE|#F^vw8N zv-i!f&C_|0CdssyKPx$LK4$72|C!Dyr^A#M>z4NF`mcRfZGSIIclq(}ch}1?z`(y3 OtXZo*ykgK`U;qF>c`_gX literal 0 HcmV?d00001 diff --git a/var/spack/repos/builtin.mock/packages/test-b/package.py b/var/spack/repos/builtin.mock/packages/test-b/package.py new file mode 100644 index 0000000000..db64b0a556 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/test-b/package.py @@ -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) diff --git a/var/spack/repos/builtin.mock/packages/test-b/test-b-0.0.tar.gz b/var/spack/repos/builtin.mock/packages/test-b/test-b-0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3588e05765cd799dfe19e1f77e057bf7508ec47e GIT binary patch literal 112 zcmb2|=3uzVq!!M={Pvt8-ysJPmJ7D0<~95|Kkb{1f}-PrX$3W18BI)~SE|#F^vw8N zv-i!f&C_|0CdssyKPx$LK4$72|C!Dyr^A#M>z4NF`mcRfZGSIIclq(}ch}1?z`(y3 OtXZo*ykgK`U;qF>c`_gX literal 0 HcmV?d00001 diff --git a/var/spack/repos/builtin.mock/packages/test-c/package.py b/var/spack/repos/builtin.mock/packages/test-c/package.py new file mode 100644 index 0000000000..0b03037466 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/test-c/package.py @@ -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) diff --git a/var/spack/repos/builtin.mock/packages/test-c/test-c-0.0.tar.gz b/var/spack/repos/builtin.mock/packages/test-c/test-c-0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3588e05765cd799dfe19e1f77e057bf7508ec47e GIT binary patch literal 112 zcmb2|=3uzVq!!M={Pvt8-ysJPmJ7D0<~95|Kkb{1f}-PrX$3W18BI)~SE|#F^vw8N zv-i!f&C_|0CdssyKPx$LK4$72|C!Dyr^A#M>z4NF`mcRfZGSIIclq(}ch}1?z`(y3 OtXZo*ykgK`U;qF>c`_gX literal 0 HcmV?d00001 diff --git a/var/spack/repos/builtin.mock/packages/test-d/package.py b/var/spack/repos/builtin.mock/packages/test-d/package.py new file mode 100644 index 0000000000..5cb7dcb2cb --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/test-d/package.py @@ -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) diff --git a/var/spack/repos/builtin.mock/packages/test-d/test-d-0.0.tar.gz b/var/spack/repos/builtin.mock/packages/test-d/test-d-0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3588e05765cd799dfe19e1f77e057bf7508ec47e GIT binary patch literal 112 zcmb2|=3uzVq!!M={Pvt8-ysJPmJ7D0<~95|Kkb{1f}-PrX$3W18BI)~SE|#F^vw8N zv-i!f&C_|0CdssyKPx$LK4$72|C!Dyr^A#M>z4NF`mcRfZGSIIclq(}ch}1?z`(y3 OtXZo*ykgK`U;qF>c`_gX literal 0 HcmV?d00001