# -*- 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             13.0.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  7a7d6c21a24ad3a931581a42a6700d5a644a6209 \
                    sha256  fd0f4a29c3e77617011b98d80e4579c31e1d58f40928d3e8fd5e434696676797 \
                    size    50725940

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

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
}
