# IT4Innovations 2020

easyblock = 'CMakeMake'

name = 'osm2pgsql'
version = '1.2.1'

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': '2018a'}

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

#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.16.2', '', True)
]

dependencies = [
    ('expat', '2.2.6', '', True),
    ('PROJ_4', '4.9.2', '', True),
    ('GEOS', '3.7.1', '-Py-2.7', True),
    ('zlib', '1.2.11', '', True),
    ('Boost', '1.68.0'),
    ('Lua', '5.1.4-8', '', True),
    ('bzip2', '1.0.6', '', True),
    ('PostgreSQL', '11.3', '-Py-2.7', True),
]

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

moduleclass = 'tools'