easyblock = 'ConfigureMake'

name = 'MIGRATE-N'
version = '4.2.8'

homepage = 'http://popgen.sc.fsu.edu/Migrate/Migrate-n.html'
description = """
Migrate estimates population parameters, effective population sizes
and migration rates of n populations, using genetic data.  It 
uses a coalescent theory approach taking into account history of 
mutations and uncertainty of the genealogy. 
"""

toolchain = {'name': 'foss', 'version': '2016a'}

sources = ['migrate-%(version)s.src.tar.gz']
source_urls = [
    'http://popgen.sc.fsu.edu/currentversions/',
    'http://popgen.sc.fsu.edu/oldversions/%(version_major)s.x/%(version_major_minor)s',
    'http://popgen.sc.fsu.edu/oldversions/',
    'http://popgen.sc.fsu.edu/newversions/',
]

patches = [
    'migrate-%(version)s_install.patch',
]

dependencies = [
    ('zlib', '1.2.8'),
]

configopts = '--enable-A4 "CC=$CC" STDCPLUS=-lstdc++ '
prebuildopts = 'make mpis && make clean && '

start_dir = 'src'

sanity_check_paths = {
    'files': ['bin/%s' % x for x in ['migrate-n','migrate-n-mpi']],
    'dirs': ['man'],
}

moduleclass = 'bio'
