easyblock = 'MakeCp'

name = 'LMDB'
version = '0.9.21'

homepage = 'https://symas.com/lmdb'
description = """LMDB is a fast, memory-efficient database. With memory-mapped files, it has the read performance
 of a pure in-memory database while retaining the persistence of standard disk-based databases."""

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

source_urls = ['https://github.com/LMDB/lmdb/archive/']
sources = ['%(name)s_%(version)s.tar.gz']
checksums = ['1187b635a4cc415bb6972bba346121f81edd996e99b8f0816151d4090f90b559']

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

buildopts = 'CC="$CC" OPT="$CFLAGS"'

runtest = 'test'

files_to_copy = [
    (['lmdb.h', 'midl.h'], 'include'),
    (['mdb_copy', 'mdb_dump', 'mdb_load', 'mdb_stat'], 'bin'),
    (['liblmdb.a', 'liblmdb.%s' % SHLIB_EXT], 'lib'),
]

sanity_check_paths = {
    'files': ['bin/mdb_copy', 'bin/mdb_dump', 'bin/mdb_load', 'bin/mdb_stat', 'include/lmdb.h',
              'include/midl.h', 'lib/liblmdb.a', 'lib/liblmdb.%s' % SHLIB_EXT],
    'dirs': [],
}

moduleclass = 'lib'
