easyblock = 'CMakeMake'

name = 'ecCodes'
version = '2.8.2'

homepage = 'https://software.ecmwf.int/wiki/display/ECC/ecCodes+Home'
description = """ecCodes is a package developed by ECMWF which provides an application programming interface and
 a set of tools for decoding and encoding messages in the following formats: WMO FM-92 GRIB edition 1 and edition 2,
 WMO FM-94 BUFR edition 3 and edition 4, WMO GTS abbreviated header (only decoding)."""

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

source_urls = ['https://confluence.ecmwf.int/download/attachments/45757960/']
sources = ['eccodes-%(version)s-Source.tar.gz']
checksums = ['36e6e73d654027b31c323b0eddd15e4d1f011ad81e79e9c71146ba96293d712a']

builddependencies = [('CMake', '3.11.4')]
dependencies = [
    ('netCDF', '4.6.1'),
    ('JasPer', '2.0.14'),
]

separate_build_dir = True

configopts = "-DENABLE_NETCDF=ON -DENABLE_JPG=ON -DENABLE_PYTHON=OFF"

sanity_check_paths = {
    'files': ['bin/%s' % x for x in ['bufr_copy', 'bufr_dump', 'bufr_filter', 'bufr_ls',
                                     'codes_count', 'codes_info', 'codes_split_file',
                                     'grib_copy', 'grib_dump', 'grib_filter', 'grib_ls']],
    'dirs': [],
}

moduleclass = 'tools'