openssl: added detection capabilities (#16653)

This commit is contained in:
Sajid Ali 2020-08-11 02:44:51 -05:00 committed by GitHub
parent 07422f95de
commit 30dc0baa34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@
import spack.architecture
import os
import re
class Openssl(Package): # Uses Fake Autotools, should subclass Package
@ -23,6 +24,8 @@ class Openssl(Package): # Uses Fake Autotools, should subclass Package
list_url = "http://www.openssl.org/source/old/"
list_depth = 1
executables = ['openssl']
# The latest stable version is the 1.1.1 series. This is also our Long Term
# Support (LTS) version, supported until 11th September 2023.
version('1.1.1g', sha256='ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46')
@ -77,6 +80,12 @@ class Openssl(Package): # Uses Fake Autotools, should subclass Package
parallel = False
@classmethod
def determine_version(cls, exe):
output = Executable(exe)('version', output=str)
match = re.search(r'OpenSSL.(\S+)*', output)
return match.group(1) if match else None
@property
def libs(self):
return find_libraries(['libssl', 'libcrypto'], root=self.prefix.lib)