openssh: support spack external find (#22445)

This commit is contained in:
Seth R. Johnson 2021-03-22 12:19:07 -04:00 committed by GitHub
parent 20fc160f21
commit 3a33d45d6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import re
class Openssh(AutotoolsPackage):
@ -40,6 +41,16 @@ class Openssh(AutotoolsPackage):
depends_on('ncurses')
depends_on('zlib')
# Note: some server apps have "ssh" in the name, so require the exact
# command 'ssh'
executables = ['^ssh$', '^rsh$']
@classmethod
def determine_version(cls, exe):
output = Executable(exe)('-V', output=str, error=str).rstrip()
match = re.search(r'OpenSSH_([^, ]+)', output)
return match.group(1) if match else None
def configure_args(self):
# OpenSSH's privilege separation path defaults to /var/empty. At
# least newer versions want to create the directory during the