# $Id: Portfile 113019 2013-11-07 01:09:20Z jann@macports.org $

PortSystem  1.0

# When updating gpg-agent, update gnupg2 also if applicable.

name            gpg-agent
version         2.0.22
categories      security mail
maintainers     nomaintainer
license         GPL-3+
installs_libs   no

description GPG key agent
long_description    gpg-agent is a key management agent similar \
                    in function to ssh-agent.
homepage        http://www.gnupg.org
platforms       darwin freebsd sunos
distname        gnupg-${version}
dist_subdir     gnupg2
master_sites    gnupg:gnupg

use_bzip2       yes

checksums       rmd160  0d47b3218438c9ddf7f91b73f2a46bbefefdb106 \
                sha256  437d0ab259854359fc48aa8795af80cff4975e559c111c92c03d0bc91408e251

configure.args  --enable-agent-only \
        --with-pinentry-pgm=${prefix}/bin/pinentry

# glib fails to find the right stdint.h  It picks clang's internal one rather
# than the system header
configure.env   gl_cv_absolute_stdint_h=/usr/include/stdint.h

depends_lib port:libiconv       \
        port:gettext        \
        port:zlib       \
        port:bzip2      \
        port:bison      \
        port:libassuan      \
        port:libksba        \
        port:libgcrypt      \
        port:libgpg-error   \
        port:pth        \
        port:pinentry

patchfiles  patch-po_Makevars.diff

post-destroot {
    # Prevent conflict with gnupg2 port.
    delete ${destroot}${prefix}/share/doc/gnupg/README
}

variant no_pinentry description {Do not use pinentry to handle user input} {
    depends_lib-delete  port:pinentry
    configure.args-delete   --with-pinentry-pgm=${prefix}/bin/pinentry
}

livecheck.type  regex
livecheck.url   ftp://ftp.gnupg.org/gcrypt/gnupg/
livecheck.regex gnupg-(\\d+\\.\\d+\\.\\d+)
