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

name                libassuan
version             3.0.2
revision            0

categories          devel
# strangely enough, only the docs are under GPL3
license             LGPL-2.1+ GPL-3+
maintainers         {larryv @larryv} \
                    {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

description         Assuan IPC library

long_description    Libassuan is a small library implementing the \
                    so-called Assuan protocol. This protocol is used \
                    for IPC between most newer GnuPG components. Both \
                    server and client side functions are provided.

homepage            https://www.gnupg.org/related_software/libassuan

depends_lib-append  port:libgpg-error \
                    port:pth

master_sites        gnupg
use_bzip2           yes

checksums           rmd160  4e39d96cee79d4a800a79ad16ff12646452694b5 \
                    sha256  d2931cdad266e633510f9970e1a2f346055e351bb19f9b78912475b8074c36f6 \
                    size    593917

# assuan-socket.c:723: error: 'fd_set' undeclared
patchfiles-append   patch-src-assuan-socket-tiger-needs-sys-select.diff

platform darwin 10 {
    # Rosetta misdetects the arch and gives a warning of a mismatch:
    # *** The config script "/opt/local/bin/gpgrt-config --libdir=/opt/local/lib gpg-error" was
    # *** built for powerpc-apple-darwin10 and thus may not match the used host x86_64-apple-darwin10.8.0.
    if {${build_arch} eq "ppc"} {
        configure.args-append --build=powerpc-apple-darwin${os.major}
    }
}

test.run            yes
test.target         check

livecheck.type      regex
livecheck.url       https://gnupg.org/download/index.html
livecheck.regex     ${name}-(\\d+(\\.\\d+)+)${extract.suffix}
