easyblock = 'ConfigureMake'

name = 'NCO'
version = '4.7.1'

homepage = "http://nco.sourceforge.net"
description = """manipulates and analyzes data stored in netCDF-accessible formats, including DAP, HDF4, and HDF5"""

toolchain = {'name': 'foss', 'version': '2017b'}

source_urls = ['http://nco.sourceforge.net/src']
sources = [SOURCELOWER_TAR_GZ]
checksums = ['3e350658117e12f0f102de0c3d1ad1756b7ebf7f43821f3d2044b4659633938b']

builddependencies = [
    ('Bison', '3.0.4'),
    ('flex', '2.6.4'),
]

dependencies = [
    ('UDUNITS', '2.2.26'),
    ('expat', '2.2.5'),
    ('ANTLR', '2.7.7'),
    ('libdap', '3.19.1'),
    ('GSL', '2.4'),
    ('netCDF', '4.6.1'),
]

sanity_check_paths = {
    'files': ['bin/nc%s' % x for x in ('ap', 'ap2', 'atted', 'bo', 'diff', 'ea', 'ecat', 'es',
                                       'flint', 'ks', 'pdq', 'ra', 'rcat', 'rename', 'wa')] +
             ['lib/libnco.a', 'lib/libnco.%s' % SHLIB_EXT, 'lib/libnco_c++.a', 'lib/libnco_c++.%s' % SHLIB_EXT],
    'dirs': ['include'],
}

moduleclass = 'tools'
