# -*- 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-base
version             2.10.6
license             GPL-3+

categories-append   sysutils
platforms           darwin
supported_archs     noarch

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

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

distname            ansible-base-${version}
checksums           rmd160  ccb5cd28ce24e08a3763395bdc14ede458beb572 \
                    sha256  c6b3bc3dc83ee510357cb7afc8c557c05ce38f6b40e9bc9dab13551b2944dfd4 \
                    size    5723168

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 38 39

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:py${python.version}-packaging \
                        port:ansible_select
    select.group    ansible
    select.file     ${filespath}/py${python.version}-ansible
    build.env-append    ANSIBLE_SKIP_CONFLICT_CHECK=1
    destroot.env-append ANSIBLE_SKIP_CONFLICT_CHECK=1
    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-base
}
