summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/automake/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/automake/package.py')
-rw-r--r--var/spack/repos/builtin/packages/automake/package.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/automake/package.py b/var/spack/repos/builtin/packages/automake/package.py
index 5327c90daf..0e9d22cb37 100644
--- a/var/spack/repos/builtin/packages/automake/package.py
+++ b/var/spack/repos/builtin/packages/automake/package.py
@@ -5,6 +5,9 @@
from spack import *
+import os
+import re
+
class Automake(AutotoolsPackage, GNUMirrorPackage):
"""Automake -- make file builder part of autotools"""
@@ -25,6 +28,24 @@ class Automake(AutotoolsPackage, GNUMirrorPackage):
build_directory = 'spack-build'
+ executables = ['automake']
+
+ @classmethod
+ def determine_spec_details(cls, prefix, exes_in_prefix):
+ exe_to_path = dict(
+ (os.path.basename(p), p) for p in exes_in_prefix
+ )
+ if 'automake' not in exe_to_path:
+ return None
+
+ exe = spack.util.executable.Executable(exe_to_path['automake'])
+ output = exe('--version', output=str)
+ if output:
+ match = re.search(r'GNU automake\)\s+(\S+)', output)
+ if match:
+ version_str = match.group(1)
+ return Spec('automake@{0}'.format(version_str))
+
def patch(self):
# The full perl shebang might be too long
files_to_be_patched_fmt = 'bin/{0}.in'