summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hartzell <hartzell@alerce.com>2016-08-01 23:56:58 -0400
committerGeorge Hartzell <hartzell@alerce.com>2016-08-02 11:16:46 -0400
commitc994565c621f4283736ac70f7792c20e2d9e1b11 (patch)
treeee8963f806fe301fef87018c222e65265b12f47a
parent1b9becc54162ed9239a03cf613f50ae7996625c3 (diff)
downloadspack-c994565c621f4283736ac70f7792c20e2d9e1b11.tar.gz
spack-c994565c621f4283736ac70f7792c20e2d9e1b11.tar.bz2
spack-c994565c621f4283736ac70f7792c20e2d9e1b11.tar.xz
spack-c994565c621f4283736ac70f7792c20e2d9e1b11.zip
Use "resource" machinery to manage cpanm tarball
Use the resource machinery to fetch/cache/unpack/... the App::cpanminus tarball. - this hardcodes the version, I can't figure out how to use a variant to hold/set the value and access it in the resource(). - change up the install to use the `with working_dir()` meme.
-rw-r--r--var/spack/repos/builtin/packages/perl/package.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py
index 47623e87c1..2c90b788ec 100644
--- a/var/spack/repos/builtin/packages/perl/package.py
+++ b/var/spack/repos/builtin/packages/perl/package.py
@@ -50,8 +50,14 @@ class Perl(Package):
# things cleanly.
variant('cpanm', default=True,
description='Having cpanm in core simplifies adding modules.')
- variant('cpanm_version', default='1.7042',
- description='Version of cpanm to install into core if +cpanm.')
+
+ resource(
+ name="cpanm",
+ url="http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7042.tar.gz",
+ md5="e87f55fbcb3c13a4754500c18e89219f",
+ destination="cpanm",
+ placement="cpanm"
+ )
def install(self, spec, prefix):
configure = Executable('./Configure')
@@ -62,9 +68,8 @@ class Perl(Package):
make("install")
if '+cpanm' in spec:
- perl_exe = join_path(prefix.bin, 'perl')
- perl = Executable(perl_exe)
- cpanm_installer = join_path(self.package_dir, 'cpanm-installer.pl')
- cpanm_version = spec.variants['cpanm_version'].value
- cpanm_package_spec = 'App::cpanminus' + '@' + cpanm_version
- perl(cpanm_installer, cpanm_package_spec)
+ with working_dir(join_path('cpanm', 'cpanm')):
+ perl = Executable(join_path(prefix.bin, 'perl'))
+ perl('Makefile.PL')
+ make()
+ make('install')