# $Id: Portfile 74865 2011-01-05 01:26:50Z ryandesign@macports.org $

PortSystem          1.0

name                lftp
version             4.1.2
categories          net
platforms           darwin
maintainers         nomaintainer

description         Sophisticated file transfer program
long_description    Lftp is a shell-like command line ftp client. It is \
                    reliable, can retry operations and does reget \
                    automatically. It can do several transfers \
                    simultaneously in background. You can start a transfer \
                    in background and continue browsing the ftp site or \
                    another one. This all is done in one process. Background \
                    jobs will be completed in nohup mode if you exit or \
                    close modem connection. Lftp has reput, mirror, reverse \
                    mirror among its features.

homepage            http://lftp.yar.ru/
master_sites        http://ftp.yars.free.net/pub/source/${name}/ \
                    http://ftp.yars.free.net/pub/source/${name}/old \
                    ftp://ftp.cs.tu-berlin.de/pub/net/ftp/${name}/
use_bzip2           yes

checksums           sha1    6804e54950d32ef74f6da2b3ffd94194d6e86e65 \
                    rmd160  25d42766fc4c5fba220adedf0da0e44540e9d514

depends_lib         port:expat \
                    port:gettext \
                    port:libiconv \
                    port:ncurses \
                    port:openssl \
                    port:readline

# look for ncurses first
patchfiles          patch-configure.diff

configure.args      --with-openssl \
                    --without-gnutls \
                    --enable-nls

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} AUTHORS BUGS ChangeLog COPYING FAQ FEATURES \
        NEWS README README.debug-levels README.modules MIRRORS THANKS TODO \
        ${docdir}
    file delete -force "${destroot}${prefix}/lib/charset.alias"
}

variant tls description {Use GnuTLS instead of OpenSSL} {
    configure.args-append   --without-openssl --with-gnutls
    configure.args-delete   --with-openssl --without-gnutls
    depends_lib-append      port:gnutls
    depends_lib-delete      port:openssl
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*) released
