easyblock = 'CMakeMake'

name = 'LMGC90'
version = '2017.rc1'

homepage = 'https://git-xen.lmgc.univ-montp2.fr/lmgc90/'
description = """LMGC90 is a free and open source software dedicated to multiple physics simulation of discrete material and structures. Module created by Jiri Tomcala from the PERMON Team (http://permon.it4i.cz) and Josef Hrabal from IT4I Superlocal_computing Services"""

toolchain = {'name': 'GCC', 'version': '6.3.0-2.27'}

source_urls = [
    'https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/repository/archive.tar.gz?ref=%(version)s&null=']
sources = [
    'lmgc90_user-%(version)s-ca01a3e325153d3fd4a03e57ce13165a92648ba1.tar.gz']

patches = ['%(name)s-%(version)s.patch']

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

dependencies = [
    ('Python', '2.7.9', '', True),
]

skipsteps = ['install']

srcdir = '%(installdir)s/lmgc90_user-%(version)s-ca01a3e325153d3fd4a03e57ce13165a92648ba1'

start_dir = '%(installdir)s'

buildininstalldir = True

postinstallcmds = [
    'mv %(installdir)s/lmgc90_user-%(version)s-ca01a3e325153d3fd4a03e57ce13165a92648ba1/examples %(installdir)s',
    'mv %(installdir)s/lmgc90_user-%(version)s-ca01a3e325153d3fd4a03e57ce13165a92648ba1/manuals %(installdir)s',
    'mv %(installdir)s/lmgc90_user-%(version)s-ca01a3e325153d3fd4a03e57ce13165a92648ba1/docs %(installdir)s',
    'mv %(installdir)s/lmgc90_user-%(version)s-ca01a3e325153d3fd4a03e57ce13165a92648ba1/test %(installdir)s',
    'rm -rf CMakeFiles lmgc90_user-2017.rc1-ca01a3e325153d3fd4a03e57ce13165a92648ba1',
    'rm CMakeCache.txt cmake_install.cmake CTestTestfile.cmake DartConfiguration.tcl LMGC90v2_devConfig.cmake Makefile'
]

modextrapaths = {'PYTHONPATH': ''}

sanity_check_paths = {
    'files': [],
    'dirs': ['bin', 'modules', 'lib'],
}

moduleclass = 'phys'
