# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 101379 2013-01-09 22:27:23Z g5pw@macports.org $

PortSystem 1.0

name            gtypist
version         2.9.1
categories      games
platforms       darwin
maintainers     josephholsten.com:joseph

description     A universal typing tutor.
long_description \
    You can learn correct typing and improve your skills \
    by practicing its exercises on a regular basis.

homepage        http://www.gnu.org/software/gtypist/
master_sites    gnu:gtypist

checksums       rmd160  753f1d2630969f5eed5830b9b4a09f2c5ca79e4c \
                sha256  a5885654aab74027999a67a9bbd7c3b6823479f89a6f1439244bf9c5536fb67d

depends_lib     port:ncurses port:gettext

configure.args  --mandir=${prefix}/share/man \
                --infodir=${prefix}/share/info

patch {
    #Fix ncursesw dependency, wide char support is included in ncurses now.
    foreach f {cursmenu.c error.c gtypist.c script.c utf8.c} {
        reinplace "s|ncursesw/ncurses.h|ncurses.h|" ${worksrcpath}/src/$f
    }
    reinplace "s|ncursesw/ncurses.h|ncurses.h|" ${worksrcpath}/configure
    reinplace "s|-lncursesw|-lncurses|" ${worksrcpath}/configure
}

livecheck.type  regex
livecheck.url   http://ftp.gnu.org/gnu/gtypist/?C=M&O=D
livecheck.regex ${name}-(\\d+(?:\\.\\d+)+)\\.tar
