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

set perl_vendor_lib [ exec sh -c "eval \"\`perl -V:installvendorlib\`\" ; echo \$installvendorlib" ]

PortSystem              1.0

name                    grid-packaging-tools
version                 3.6.3
revision                1
platforms               darwin
categories              devel
license                 NCSA
maintainers             nikhef.nl:dennisvd fysast.uu.se:mattias.ellert nbi.ku.dk:skou
homepage                http://www.gridpackagingtools.com/

description             Grid Packaging Tools (GPT)
long_description        GPT is a collection of packaging tools built \
                        around an XML based packaging data format. \
                        This format provides a straight forward way to \
                        define complex dependency and compatibility \
                        relationships between packages. The tools \
                        provide a means for developers to easily \
                        define the packaging data and include it as \
                        part of their source code distribution. \
                        Binary packages can be automatically generated \
                        from this data. The packages defined by GPT \
                        are compatible with other packages and can be \
                        easily converted.

depends_build           port:perl5 \
                        port:libtool

depends_run             port:perl5 \
                        port:p5-archive-tar \
                        port:autoconf \
                        port:automake \
                        port:libtool

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

distfiles               gpt-3.6.3.tar.gz

checksums               gpt-3.6.3.tar.gz \
                            sha256 9aa59106de539476ab0c8d8c119f168e877a696c48737e5583b3fb561068a4e8 \
                            rmd160 a4d7d12318ad990b576ac018f6fc903615ddd38e

worksrcdir              gpt-3.6.3

configure.post_args     --libexecdir='\${datadir}/globus' \
                        --mandir='\${datadir}/man' \
                        --with-perlmoduledir=${perl_vendor_lib} \
                        --disable-compat --with-newgpt

destroot.target-append  install-man

pre-configure {
    touch ${worksrcpath}/aclocal.m4
    touch ${worksrcpath}/Makefile.in
    touch ${worksrcpath}/configure
    file attributes ${worksrcpath}/install-sh -permissions +x

    foreach i {config.guess config.sub} {
        file copy -force ${prefix}/share/libtool/config/$i ${worksrcpath}/$i
    }
}

post-destroot {
    # Rename libtoolize to glibtoolize
    reinplace "s/libtoolize/glibtoolize/g" \
        ${destroot}${prefix}/share/globus/gpt-bootstrap.sh

    # Install documentation
    file mkdir ${destroot}${prefix}/share/doc/${name}-${version}
    xinstall -m 644 ${worksrcpath}/CHANGES \
        ${worksrcpath}/LICENSE ${worksrcpath}/README \
        ${destroot}${prefix}/share/doc/${name}-${version}
}
