# -*- 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        italiangrid voms 2.1.2 v
revision            0
categories          security
maintainers         nikhef.nl:okoeroo
license             Apache-2

description         Create a proxy with VOMS extensions
long_description    The voms-proxy-init generates a proxy with the VOMS information included in a non-critical extension.

checksums           rmd160  74aeb5bcb9da5bb6bec3f21d6173759feae26205 \
                    sha256  171cfa66b000422761b2a534a84ad88b646c675ff7910409b08b900775dbf035 \
                    size    482314
github.tarball_from archive

patchfiles          patch-ipv6sock-posix.diff

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool

depends_lib-append  port:expat \
                    port:gsoap \
                    port:zlib

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

compiler.cxx_standard   2011

configure.args-append \
                    --with-gsoap-wsdl2h=${prefix}/bin/wsdl2h

# Fix build conflict with mongodb's ${prefix}/include/server.h
configure.cppflags-delete -I${prefix}/include
configure.cppflags-append -isystem${prefix}/include

# The build fails to link on its own:
# Undefined symbols for architecture ppc: "_crc32"
# See also: https://github.com/NixOS/nixpkgs/blob/5a0711127cd8b916c3d3128f473388c8c79df0da/pkgs/by-name/vo/voms/package.nix
configure.ldflags-append \
                    -lz

pre-test {
    if {![file exists ${prefix}/bin/runtest]} {
        ui_error "To test ${name}, you must first install the dejagnu port."
        return -code error "dejagnu is not installed"
    }
}

test.run            yes
test.target         check
