easyblock = 'ConfigureMake'

name = 'libreadline'
version = '6.3'

homepage = 'http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html'
description = """ The GNU Readline library provides a set of functions for use
    by applications that allow users to edit command lines as they are typed
    in. Both Emacs and vi editing modes are available. The Readline library
    includes additional functions to maintain a list of previously-entered
    command lines, to recall and perhaps reedit those lines, and perform
    csh-like history expansion on previous commands."""

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

sources = ['readline-%(version)s.tar.gz']
source_urls = ['http://ftp.gnu.org/gnu/readline']

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

dependencies = [('ncurses', '5.9')]

# for the termcap symbols, use EB ncurses
preconfigopts = "env LDFLAGS='-lncurses'"

sanity_check_paths = {
    'files': ['lib/libreadline.a', 'lib/libhistory.a'] +
             ['include/readline/%s' % x for x in ['chardefs.h', 'history.h', 'keymaps.h', 'readline.h', 'rlconf.h',
                                                  'rlstdc.h', 'rltypedefs.h', 'tilde.h']],
    'dirs': [],
}

moduleclass = 'lib'
