# -*- 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

PortSystem      1.0
PortGroup       github 1.0
PortGroup       openssl 1.0

github.setup    masneyb gftp 2.9.1b
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision        0
categories      net
license         GPL-2+
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/

checksums       rmd160  523938683564a045305338a3ef03ae8a1a56ee58 \
                sha256  c0198f26b05b1156b37f1bc51f1359490e031a43e3acf6d145235063be3cf93c \
                size    1557295

patchfiles      patch-openpty.diff

depends_build-append \
                port:autoconf \
                port:automake \
                port:gettext \
                port:libtool \
                port:pkgconfig
depends_lib-append \
                path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \
                port:gettext-runtime \
                port:ncurses \
                port:readline

pre-configure {
    system "cd ${worksrcpath} && ./autogen.sh"
}

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.args-append       --mandir=${prefix}/share/man \
                            --disable-glibtest \
                            --disable-gtktest

configure.ldflags-append    -bind_at_load
