easyblock = 'CMakeMake'

name = 'osm2pgsql'
version = '0.92.0'

homepage = 'http://wiki.openstreetmap.org/wiki/Osm2pgsql'
description = "osm2pgsql is a command-line based program that converts OpenStreetMap data to postGIS-enabled PostgreSQL databases"

toolchain = {'name': 'intel', 'version': '2017a' }

source_urls = ['https://github.com/openstreetmap/osm2pgsql/archive/']
sources = ['%(version)s.tar.gz']

checksums = ['1aee8d5fcea0e51662640a886a6818c7']

patches = ['osm2pgsql-%(version)s_fix.patch']

files_to_copy = ['%(builddir)s/osm2pgsql']

configopts = '-DCMAKE_CXX_COMPILER=icpc -DCMAKE_CXX_FLAGS=-std=c++11'

separate_build_dir = True

builddependencies = [
  ('CMake', '3.7.2', '', True)
]

dependencies = [ 
    ('expat', '2.1.0', '', True), 
    ('PROJ_4', '4.9.2', '', True), 
    ('GEOS', '3.5.0', '', True), 
    ('zlib', '1.2.11', '', True), 
    ('Boost', '1.63.0'),
    ('Lua', '5.1.4-8', '', True)
]

sanity_check_paths = {
    'files': ['bin/osm2pgsql'],
    'dirs': [],
}
                                                                                                                                                   
moduleclass = 'tools'
