##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
# Copyright:: Copyright 2018 IT4Innovations, VSB - TU Ostrava
# Authors::   Martin Golasowski <martin.golasowski@vsb.cz>
# License::   MIT/GPL
# $Id$
#
# This work implements a part of the HPCBIOS project and is a component of the policy:
# http://hpcbios.readthedocs.org/en/latest/
##

easyblock = 'ConfigureMake'
name = 'SpatiaLite'
version = '4.3.0a'

homepage = 'https://www.gaia-gis.it/fossil/libspatialite/index'
description = """SpatiaLite is an open source library intended to extend the SQLite core to support
fully fledged Spatial SQL capabilities.
"""
toolchain = {'name': 'system', 'version': ''}

source_urls = ['http://www.gaia-gis.it/gaia-sins/']
sources = ['lib%(namelower)s-%(version)s.tar.gz']

dependencies = [
    ('SQLite', '3.21.0'),
    ('PROJ_4', '4.9.2', '', True),
    ('GEOS', '3.5.0', '', True),
    ('GDAL', '2.1.3', '-Python-2.7.13'),
    ('expat', '2.1.0', '', True),
    ('libxml2', '2.9.4', '', True),
]

preconfigopts = 'export LIBS="-lm -lpthread -L/apps/all/SQLite/3.18.2-GCC-6.3.0-2.27/lib" && '

configopts = '--disable-freexl'

sanity_check_paths = {
    'files': ['include/spatialite.h', 'lib/libspatialite.so'],
    'dirs': ['lib', 'include']
}

moduleclass = 'lib'
