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

# $Id$

if {$build_arch == "x86_64" || $build_arch == "ppc64"} {
    set flavor gcc64pthr
} else {
    set flavor gcc32pthr
}

PortSystem              1.0

name                    globus-gram-client-tools
set _name               [ string map {"-" "_"} $name ]
version                 10.4
revision                1
platforms               darwin
categories              net
license                 Apache-2
maintainers             nikhef.nl:dennisvd
homepage                http://www.globus.org/

description             Globus Toolkit - Job Management Tools (globusrun)
long_description        The Globus Toolkit is an open source software \
                        toolkit used for building Grid systems and \
                        applications. It is being developed by the \
                        Globus Alliance and many others all over the \
                        world. A growing number of projects and \
                        companies are using the Globus Toolkit to \
                        unlock the potential of grids for their \
                        cause. The ${name} package contains: \
                        The client tools for the Resource Allocation \
                        Management System, such as globusrun and \
                        globus-job-submit.

master_sites            http://www.globus.org/ftppub/gt5/5.2/5.2.4/packages/src/

distfiles               ${_name}-${version}.tar.gz

checksums               ${_name}-${version}.tar.gz \
                            sha256 5d1edab1b26be8ea100476cff3b3e7828c317aa498bfde854421a498942134a6 \
                            rmp160 4c77c458c300370ed7b9d882bb05ee1a421b87d7

depends_run             port:globus-common \
                        port:globus-gram-client \
                        port:globus-gram-protocol \
                        port:globus-gass-transfer \
                        port:globus-gass-server-ez \
                        port:globus-rsl \
                        port:globus-gss-assist

depends_build           port:grid-packaging-tools \
                        port:globus-core \
                        port:globus-common \
                        port:globus-gram-client \
                        port:globus-gram-protocol \
                        port:globus-gass-transfer \
                        port:globus-gass-server-ez \
                        port:globus-rsl \
                        port:globus-gss-assist

worksrcdir              ${_name}-${version}

configure.env-append    GPT_LOCATION=${prefix} \
                        GLOBUS_LOCATION=${prefix}

configure.post_args     --with-flavor=${flavor} \
                        --with-docdir='\${datadir}/doc/${name}-${version}'

build.env-append        GPT_LOCATION=${prefix} \
                        GLOBUS_LOCATION=${prefix}

pre-configure {
    # Remove files that should be replaced during bootstrap
    eval file delete -force \
        [ glob -nocomplain ${worksrcpath}/doxygen/Doxyfile* ] dummy
    file delete -force ${worksrcpath}/doxygen/Makefile.am
    file delete -force ${worksrcpath}/pkgdata/Makefile.am
    eval file delete -force \
        [ glob -nocomplain ${worksrcpath}/globus_automake* ] dummy

    system "cd $worksrcpath && \
        GPT_LOCATION=${prefix} GLOBUS_LOCATION=${prefix} \
        ${prefix}/share/globus/globus-bootstrap.sh"
}

