# $Id$

PortSystem      1.0

name            gftp
version         2.0.18
revision        5
categories      net
license         GPL-2+
platforms       darwin
maintainers     nomaintainer
description     GTK+ FTP client

long_description \
    gFTP is a free multithreaded file transfer client for *NIX based machines.

homepage        http://www.gftp.org/
master_sites    ${homepage} \
                ftp://www.gftp.org/pub/gftp/

use_bzip2       yes

checksums       md5 44b19442d06f6dc68c7211d66029d826 \
                sha1 c2468f1ff1fe978a5fab3a198e513558f3b48f5a \
                rmd160 0e0daea8543ae822b25635647360193362a2648d

depends_build   port:pkgconfig
depends_lib     port:gtk2 \
                port:gettext \
                path:lib/libssl.dylib:openssl \
                port:readline \
                port:ncurses

post-configure {
    reinplace "s/#undef HAVE_OPENPTY/#define HAVE_OPENPTY 1/" ${worksrcpath}/config.h
    reinplace "s/#define HAVE_GRANTPT 1/#undef HAVE_GRANTPT/" ${worksrcpath}/config.h
}

configure.ldflags-append    -bind_at_load
configure.args              --mandir=${prefix}/share/man \
                            --disable-glibtest \
                            --disable-gtktest

post-destroot {
    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}/html
    xinstall -m 0644 -W ${worksrcpath} AUTHORS COPYING ChangeLog NEWS README \
        THANKS TODO ${destroot}${docdir}
    xinstall -m 0644 ${worksrcpath}/README.html ${destroot}${docdir}/html
}