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

PortSystem          1.0
PortGroup           python 1.0

name                google-cloud-sdk
version             121.0.0
categories          devel python
license             Apache-2
maintainers         nomaintainer
description         Command-line interface for Google Cloud Platform products and services
long_description    ${description}

platforms           darwin
supported_archs     i386 x86_64

homepage            https://cloud.google.com/sdk/
master_sites        https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/

distname            ${name}-${version}-${os.platform}-${configure.build_arch}
worksrcdir          ${name}

checksums           rmd160  3e8a0899f2dc41941d5867d76ad3b2c8426e314a \
                    sha256  1c5d48a12c1d51e5d807939489acbe1ce23abc328836f7657c27d1723b8c6558

python.default_version 27

use_configure       no
build               {}

destroot {
    foreach file {gcloud bq gsutil} {
        copy ${worksrcpath}/bin/${file} ${destroot}${prefix}/bin
    }
    copy ${worksrcpath}/bin/git-credential-gcloud.sh ${destroot}${prefix}/bin/git-credential-gcloud

    copy {*}[glob -directory ${worksrcpath}/lib *] ${destroot}${prefix}/lib

    if {[variant_isset bash_completion]} {
        # set completions_path ${prefix}/share/bash-completion/completions
        set completions_path ${prefix}/etc/bash_completion.d
        xinstall -d ${destroot}${completions_path}
        xinstall -m 644 ${worksrcpath}/completion.bash.inc ${destroot}${completions_path}/google-cloud-sdk
    }
}

variant bash_completion {
    depends_run-append path:etc/bash_completion:bash-completion
}