#!/usr/bin/env python
# Paths associated with Code_Saturne, generated from cs_config.py.in by make.
#============================================================================
#
#     This file is part of the Code_Saturne Kernel, element of the
#     Code_Saturne CFD tool.
#
#     Copyright (C) 2009-2011 EDF S.A., France
#
#     contact: saturne-support@edf.fr
#
#     The Code_Saturne Kernel is free software; you can redistribute it
#     and/or modify it under the terms of the GNU General Public License
#     as published by the Free Software Foundation; either version 2 of
#     the License, or (at your option) any later version.
#
#     The Code_Saturne Kernel is distributed in the hope that it will be
#     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with the Code_Saturne Kernel; if not, write to the
#     Free Software Foundation, Inc.,
#     51 Franklin St, Fifth Floor,
#     Boston, MA  02110-1301  USA
#
#============================================================================

#-------------------------------------------------------------------------------

import os.path

# Package Version
#----------------

class package:
    name="ncs"
    version="2.0.4"

# Installation directories
#-------------------------

class dirs:
    prefix = "/usr/local"
    exec_prefix = "/usr/local"
    bindir = "/usr/local/bin"
    includedir = "/usr/local/include"
    libdir = "/usr/local/lib"
    datarootdir = "/usr/local/share"
    datadir = "/usr/local/share"
    pkgdatadir = "/usr/local/share/ncs"
    docdir = "/usr/local/share/doc/ncs"
    pdfdir = "/usr/local/share/doc/ncs"
    ecs_bindir = "/usr/local/bin"
    syrthes_prefix = ""

# Optional MPI library info
#--------------------------

class mpi_lib:
    type = "MPICH2"
    bindir = ""
    libdir = ""

# Optional Environment modules
#-----------------------------

class env_modules:
    modules = "no"
    modules_cmd = ""

#-------------------------------------------------------------------------------

def get_config():
    """
    Get the configuration information.
    """
    msg = """\
Directories:
  dirs.prefix = %(prefix)s
  dirs.exec_prefix = %(exec_prefix)s
  dirs.bindir = %(bin)s
  dirs.includedir = %(include)s
  dirs.libdir = %(lib)s
  dirs.datarootdir = %(dataroot)s
  dirs.datadir = %(data)s
  dirs.pkgdatadir = %(pkgdata)s
  dirs.docdir = %(doc)s
  dirs.pdfdir = %(pdf)s

Auxiliary information:
  dirs.ecs_bindir = %(ecs)s
  dirs.syrthes_prefix = %(syrthes)s

MPI library information:
  mpi_lib.type = %(mpi_type)s
  mpi_lib.bindir = %(mpi_bindir)s
  mpi_lib.libdir = %(mpi_libdir)s\
"""

    return msg \
        % { 'prefix':dirs.prefix, 'exec_prefix':dirs.exec_prefix,
            'bin':dirs.bindir, 'include': dirs.includedir, 'lib':dirs.libdir,
            'dataroot':dirs.datarootdir, 'data':dirs.datadir,
            'pkgdata':dirs.pkgdatadir, 'doc':dirs.docdir, 'pdf':dirs.pdfdir,
            'ecs':dirs.ecs_bindir, 'syrthes':dirs.syrthes_prefix,
            'mpi_type':mpi_lib.type, 'mpi_bindir':mpi_lib.bindir,
            'mpi_libdir':mpi_lib.libdir }

#-------------------------------------------------------------------------------

def main(argv):
    """
    Main configuration info function.
    """
    import sys
    import cs_config_build
    sys.stdout.write("%(d)s\n\n%(b)s\n\n%(s)s\n" %
                     {'d':get_config(),
                      'b':cs_config_build.get_config(),
                      's':cs_config_build.get_config_syrthes()})

if __name__ == '__main__':
    import sys
    main(sys.argv[1:])

