summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-05-10 01:30:13 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-05-10 01:30:13 -0700
commit57e495943fd38c07afa52b55c2868d16bcdeac6b (patch)
treef3c40815e992b5501437b5041911e1126ba17f78 /lib
parentb1da3664ec5de664f2bf4bf49ddcc083dd6037f1 (diff)
parent2b7b7f6d9758d47bb59b59e92cb2c7e3b785ac51 (diff)
downloadspack-57e495943fd38c07afa52b55c2868d16bcdeac6b.tar.gz
spack-57e495943fd38c07afa52b55c2868d16bcdeac6b.tar.bz2
spack-57e495943fd38c07afa52b55c2868d16bcdeac6b.tar.xz
spack-57e495943fd38c07afa52b55c2868d16bcdeac6b.zip
Merge pull request #757 from glennpj/extend_r
Make R extendable
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/create.py8
-rw-r--r--lib/spack/spack/url.py3
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py
index f0cd50b8df..e3a31806ab 100644
--- a/lib/spack/spack/cmd/create.py
+++ b/lib/spack/spack/cmd/create.py
@@ -124,10 +124,12 @@ class ConfigureGuesser(object):
autotools = "configure('--prefix=%s' % prefix)"
cmake = "cmake('.', *std_cmake_args)"
python = "python('setup.py', 'install', '--prefix=%s' % prefix)"
+ r = "R('CMD', 'INSTALL', '--library=%s' % self.module.r_lib_dir, '%s' % self.stage.archive_file)"
config_lines = ((r'/configure$', 'autotools', autotools),
(r'/CMakeLists.txt$', 'cmake', cmake),
- (r'/setup.py$', 'python', python))
+ (r'/setup.py$', 'python', python),
+ (r'/NAMESPACE$', 'r', r))
# Peek inside the tarball.
tar = which('tar')
@@ -272,6 +274,10 @@ def create(parser, args):
if guesser.build_system == 'python':
name = 'py-%s' % name
+ # Prepend 'r-' to R package names, by convention.
+ if guesser.build_system == 'r':
+ name = 'r-%s' % name
+
# Create a directory for the new package.
pkg_path = repo.filename_for_package_name(name)
if os.path.exists(pkg_path) and not args.force:
diff --git a/lib/spack/spack/url.py b/lib/spack/spack/url.py
index f51f05cad7..ad51da9d47 100644
--- a/lib/spack/spack/url.py
+++ b/lib/spack/spack/url.py
@@ -206,6 +206,9 @@ def parse_version_offset(path):
# e.g. lame-398-1
(r'-((\d)+-\d)', stem),
+ # e.g. foobar_1.2-3
+ (r'_((\d+\.)+\d+(-\d+)?[a-z]?)', stem),
+
# e.g. foobar-4.5.1
(r'-((\d+\.)*\d+)$', stem),