#
# author: Dina Mahmoud Ibrahim (Cairo University)
#
easyblock = 'ConfigureMake'

name = 'ns'
version = '2.35'

homepage = 'http://nsnam.isi.edu/nsnam'
description = "Ns-2 is a discrete event simulator targeted at networking research. "

toolchain = {'name': 'ictce', 'version': '5.3.0'}
toolchainopts = {'pic': True}

sources = ['%(name)s-src-%(version)s.tar.gz']
source_urls = ['http://sourceforge.net/projects/nsnam/files/ns-2/%(version)s/', 'download']

patches = ['ns_GCC-4.7.patch']

tcl_ver = '8.5.12'
dependencies = [
    ('Tcl', tcl_ver),
    ('Tk', tcl_ver),
    ('otcl', '1.14'),
    ('tclcl', '1.20'),
]

configopts = "--with-otcl=$EBROOTOTCL --with-tcl=$EBROOTTCL --with-tcl-ver=$EBVERSIONTCL "
configopts += "--with-tk=$EBROOTTK --with-tk-ver=$EBVERSIONTK --with-tclcl=$EBROOTTCLCL "
configopts += "--with-tclcl-ver=$EBVERSIONTCLCL"

preinstallopts = "mkdir -p %(installdir)s/bin && "

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

moduleclass = 'tools'
