easyblock = 'ConfigureMake'

name = 'PostgreSQL'
version = '9.6.9'

homepage = 'http://www.mysql.com/'
description = """PostgreSQL is a powerful, open source object-relational database system.
 It is fully ACID local_compliant, has full support for foreign keys,
 joins, views, triggers, and stored procedures (in multiple languages).
 It includes most SQL:2008 data types, including INTEGER,
 NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP.
 It also supports storage of binary large objects, including pictures,
 sounds, or video. It has native programming interfaces for C/C++, Java,
 .Net, Perl, Python, Ruby, Tcl, ODBC, among others, and exceptional documentation."""

source_urls = ['http://ftp.postgresql.org/pub/source/v%(version)s/']
sources = [SOURCELOWER_TAR_GZ]

toolchain = {'name': 'Py', 'version': '2.7'}

osdependencies = [('openssl-devel', 'libssl-dev')]

dependencies = [
    ('libreadline', '7.0', '', True),
    ('zlib', '1.2.11', '', True),
]

builddependencies = [
    ('Bison', '3.0.4', '', True),
    ('flex', '2.6.0', '', True),
    ('Perl', '5.26.2', '-GCC-6.3.0-2.27', True),
]

configopts = '--with-python --with-openssl'

sanity_check_paths = {
    'files': [
        'bin/psql',
        'bin/pg_config',
        'lib/libpq.a',
        'lib/libpq.%s' %
        SHLIB_EXT],
    'dirs': ['share/postgresql'],
}

moduleclass = 'data'
