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 = SYSTEM
toolchainopts = {'pic': True}

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

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

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': [],
}

buildopts = "CC=gcc CFLAGS='-O3 -fPIC'"

moduleclass = 'lib'
