easyblock = 'ConfigureMake'

name = 'cURL'
version = '7.60.0'

homepage = 'http://curl.haxx.se'

description = """
 libcurl is a free and easy-to-use client-side URL transfer library,
 supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP,
 LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP.
 libcurl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP
 form based upload, proxies, cookies, user+password authentication (Basic,
 Digest, NTLM, Negotiate, Kerberos), file transfer resume, http proxy tunneling
 and more.
"""

toolchain = {'name': 'GCCcore', 'version': '6.4.0'}

source_urls = ['https://curl.haxx.se/download/']
sources = [SOURCELOWER_TAR_GZ]
checksums = ['e9c37986337743f37fd14fe8737f246e97aec94b39d1b71e8a5973f72a9fc4f5']

builddependencies = [
    ('binutils', '2.30'),
]

dependencies = [
    ('zlib', '1.2.11'),
    # OS dependency should be preferred if the os version is more recent then this version,
    # it's nice to have an up to date openssl for security reasons
    # ('OpenSSL', '1.1.0h')
]

osdependencies = [
    ('openssl-devel', 'libssl-dev', 'libopenssl-devel'),
]

configopts = '--with-zlib'
# configopts += '--with-ssl=$EBROOTOPENSSL'

modextravars = {'CURL_INCLUDES': '%(installdir)s/include'}

sanity_check_paths = {
    'files': ['bin/curl', 'lib/libcurl.a', 'lib/libcurl.%s' % SHLIB_EXT],
    'dirs': ['lib/pkgconfig'],
}

moduleclass = 'tools'
