# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 86988 2011-11-07 20:50:11Z dports@macports.org $

PortSystem                  1.0

name                        pinentry
version                     0.8.0
revision                    1
categories                  security
license                     GPL-2+
maintainers                 nomaintainer
homepage                    http://www.gnupg.org/aegypten2
platforms                   darwin
master_sites                gnupg

description                 Passphrase entry dialog utilizing the Assuan protocol

long_description            This is a collection of simple PIN or passphrase entry \
                            dialogs which utilize the Assuan protocol as described by \
                            the aegypten project.

checksums                   md5     590be1b00f9ab63205843c7fed8caf35 \
                            sha1    381f9ee47b9f198e1be5d3ec4e043067a7e97912 \
                            rmd160  966e830fb86c1820057979f581ca71f82a4fc9e0

configure.args              --mandir=${prefix}/share/man \
                            --infodir=${prefix}/share/info \
                            --with-libiconv-prefix=${prefix} \
                            --with-ncurses-include-dir=${prefix}/include/ncurses \
                            --enable-pinentry-curses \
                            --disable-pinentry-gtk2 \
                            --disable-pinentry-gtk \
                            --disable-pinentry-qt4 \
                            --disable-pinentry-qt

depends_lib                 port:libiconv \
                            port:ncurses

variant gtk1 description {Enable gtk1 pinentry} {
    depends_lib-append      port:gtk1
    configure.args-delete   --disable-pinentry-gtk
    configure.args-append   --enable-pinentry-gtk \
                            --enable-fallback-curses
}

variant gtk2 description {Enable gtk2 pinentry} {
    depends_lib-append      port:gtk2
    configure.args-delete   --disable-pinentry-gtk2
    configure.args-append   --enable-pinentry-gtk2 \
                            --enable-fallback-curses
}

variant qt3 description {Enable qt3 pinentry} {
    depends_lib-append      port:qt3
    configure.env-append    QTDIR=${prefix}/lib \
                            MOC=${prefix}/bin/moc
    configure.args-delete   --disable-pinentry-qt
    configure.args-append   --enable-pinentry-qt \
                            --enable-fallback-curses \
                            --with-qt-includes=${prefix}/include/qt3 \
                            --with-qt-libraries=${prefix}/lib
}

variant qt4 description {Enable qt4 pinentry} {
    PortGroup qt4 1.0
    configure.args-delete   --disable-pinentry-qt4
    configure.args-append   --enable-pinentry-qt4 \
                            --enable-fallback-curses \
                            --with-qt-includes=${qt_includes_dir} \
                            --with-qt-libraries=${qt_libs_dir}
}

platform darwin {
    configure.args-append   --disable-rpath
}

livecheck.type              regex
livecheck.url               ftp://ftp.gnupg.org/gcrypt/pinentry/
livecheck.regex             ${name}-(\\d+\\.\\d+\\.\\d+)
