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

name                py-ansible
version             11.1.0
revision            0
license             GPL-3+

categories-append   sysutils
supported_archs     noarch
platforms           {darwin any}

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

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

checksums           rmd160  0a2f65660e4ddb0330e0780f8d07c75e61a70505 \
                    sha256  d01b425990d960d2a33fc378e1b73dbca1c0e28bc22f4056ab6b3c8e9ae74fba \
                    size    41299850

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     39 310 311 312 313

if {${name} ne ${subport}} {
    patch {
        # This is a little ugly, but it works, and it is over 10x faster on
        # systems with anti-virus than using a foreach (even a foreach limited
        # to matching files).
        system -W ${worksrcpath} \
            "find -E . -type f -regex '.*\.(py|ya?ml)' \
                  -exec egrep -l '(/etc|/usr/share)/ansible' '{}' '+' |
             xargs sed -i '' -e 's^/etc/ansible^${prefix}/etc/ansible^g' \
                       -e 's^/usr/share/ansible^${prefix}/share/ansible^g'"
    }
    depends_lib-append  port:py${python.version}-ansible-core
}
