# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 79463 2011-06-14 14:13:34Z and.damore@macports.org $

PortSystem 1.0

name                mc
version             4.7.5.2
categories          sysutils
maintainers         waqar openmaintainer
license             GPLv2
description         GNU Midnight Commander
long_description    \
                    GNU Midnight Commander is a user-friendly yet powerful file \
                    manager and visual shell, useful to novice and guru alike. \
                    It provides a clear, user-friendly, and somewhat protected \
                    interface to a Unix system while making many frequent file \
                    operations more efficient and preserving the full power of \
                    the command prompt. After some practice, you will wonder how \
                    you could ever live without it.
homepage            http://www.midnight-commander.org/
platforms           darwin
master_sites        ${homepage}downloads

use_xz              yes
extract.suffix      .tar.lzma

checksums           md5     9fede28ed63ced53f1beeba2f95473da \
                    sha1    fb44d01a80c5e4589aece205adccff5b5a5c34c1 \
                    rmd160  8477450d0f2cddc356d93c5006fcfd278966f863

depends_build       path:bin/pkg-config:pkgconfig
depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2

configure.args      --without-x

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS \
        COPYING \
        NEWS \
        README \
        ${docdir}
}

variant slang2 conflicts ncurses description {use slang2 screen library} {
    depends_lib-append      port:slang2
    configure.args-append   --with-screen=slang \
                            --with-slang-includes=${prefix} \
                            --with-slang-libs=${prefix}
}

variant ncurses conflicts slang2 description {use ncurses screen library} {
    depends_lib-append      port:ncursesw
    configure.args-append   --with-screen=ncurses
}

if { ![variant_isset ncurses] } {
    default_variants        +slang2
}

livecheck.type  regex
livecheck.url   [lindex ${master_sites} 0]
livecheck.regex ${name}-(\[0-9.\]+)\\.tar
