# -*- 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           python 1.0
PortGroup           select 1.0

name                py-ansible
version             2.7.9
license             GPL-3+

categories-append   sysutils
platforms           darwin
supported_archs     noarch

maintainers         {adfernandes @adfernandes} {blair @blair} {gmail.com:pedro.salgado @steenzout}

master_sites        pypi:a/ansible
homepage            https://github.com/ansible/ansible
description         SSH-based configuration management and deployment system

distname            ansible-${version}
checksums           rmd160  4c0b0e4ead682131b785777396f86dca650d2a60 \
                    sha256  6ee59d561c206f82e842f3aae4b56fc9a8b83ffecba4cab33bdb56f781717ea7 \
                    size    11830476

conflicts           ansible

long_description \
    Ansible is a radically simple model-driven configuration \
    management, multi-node deployment, and remote task execution \
    system.  Ansible works over SSH and does not require any software \
    or daemons to be installed on remote nodes.  Extension modules can \
    be written in any language and are transferred to managed machines \
    automatically.

python.versions 27 35 36 37

if {${name} ne ${subport}} {
    patch {
        fs-traverse f ${worksrcpath} {
            if {[file isfile ${f}] && [regexp {\.(py|yml|yaml)$} ${f} match]} {
                reinplace -q "s#/etc/ansible#${prefix}/etc/ansible#g" ${f}
                reinplace -q "s#/usr/share/ansible#${prefix}/share/ansible#g" ${f}
            }
        }
    }
    depends_lib-append  port:py${python.version}-six \
                        port:py${python.version}-paramiko \
                        port:py${python.version}-httplib2 \
                        port:py${python.version}-jinja2 \
                        port:py${python.version}-yaml \
                        port:py${python.version}-setuptools \
                        port:py${python.version}-cryptography \
                        port:ansible_select
    select.group    ansible
    select.file     ${filespath}/py${python.version}-ansible
    notes "
To make the Python ${python.branch} version of Ansible the one that is run\
when you execute the commands without a version suffix, e.g. 'ansible', run:

port select --set ${select.group} [file tail ${select.file}]
"
    livecheck.type  none
} else {
    livecheck.name  ansible
}