Ticket #55229: _ansible.patch

File _ansible.patch, 9.0 KB (added by adfernandes (Andrew Fernandes), 6 years ago)

Major Portfile Update

  • new file python/ansible_select/Portfile

    diff --git a/python/ansible_select/Portfile b/python/ansible_select/Portfile
    new file mode 100644
    index 0000000000..e8895f0e8c
    - +  
     1# -*- 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
     2
     3PortSystem          1.0
     4PortGroup           select 1.0
     5
     6name                ansible_select
     7version             0.1
     8categories          sysutils
     9platforms           darwin
     10supported_archs     noarch
     11license             BSD
     12maintainers         {adfernandes @adfernandes} openmaintainer
     13
     14description         Common files for selecting the default Ansible version
     15long_description    This port installs files that allow 'port select' to \
     16                    create links to the preferred default version of Ansible.\
     17
     18homepage            http://www.macports.org
     19
     20distfiles
     21use_configure       no
     22build               { }
     23
     24destroot {
     25    select::install ansible ${filespath}/base
     26    select::install ansible ${filespath}/none
     27}
     28
     29livecheck.type     none
  • new file python/ansible_select/files/base

    diff --git a/python/ansible_select/files/base b/python/ansible_select/files/base
    new file mode 100644
    index 0000000000..f8c7dfd804
    - +  
     1bin/ansible
     2bin/ansible-config
     3bin/ansible-connection
     4bin/ansible-console
     5bin/ansible-doc
     6bin/ansible-galaxy
     7bin/ansible-inventory
     8bin/ansible-playbook
     9bin/ansible-pull
     10bin/ansible-vault
  • new file python/ansible_select/files/none

    diff --git a/python/ansible_select/files/none b/python/ansible_select/files/none
    new file mode 100644
    index 0000000000..b63a30ca5e
    - +  
     1-
     2-
     3-
     4-
     5-
     6-
     7-
     8-
     9-
     10-
  • new file python/py-ansible/Portfile

    diff --git a/python/py-ansible/Portfile b/python/py-ansible/Portfile
    new file mode 100644
    index 0000000000..7bcd89c9f4
    - +  
     1# -*- 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
     2
     3PortSystem          1.0
     4PortGroup           python 1.0
     5PortGroup           select 1.0
     6
     7name                py-ansible
     8version             2.4.1.0
     9license             BSD
     10
     11categories-append   sysutils
     12platforms           darwin
     13supported_archs     noarch
     14
     15maintainers         {adfernandes @adfernandes} blair gmail.com:pedro.salgado
     16
     17master_sites        pypi:a/ansible
     18homepage            https://github.com/ansible/ansible
     19description         SSH-based configuration management and deployment system
     20
     21distname            ansible-${version}
     22checksums           rmd160  75fe5ce2b60442ef9eb345fbd3fd9e356860f026 \
     23                    sha256  da61afb29cc5bd6bc4737a2da06e673fb6fccc3ae2685130d19ab3a8e404fb6a
     24
     25long_description \
     26    Ansible is a radically simple model-driven configuration \
     27    management, multi-node deployment, and remote task execution \
     28    system.  Ansible works over SSH and does not require any software \
     29    or daemons to be installed on remote nodes.  Extension modules can \
     30    be written in any language and are transferred to managed machines \
     31    automatically.
     32
     33python.versions 27 35 36
     34
     35
     36if {${name} ne ${subport}} {
     37
     38
     39    depends_lib-append  port:py${python.version}-six \
     40                        port:py${python.version}-paramiko \
     41                        port:py${python.version}-httplib2 \
     42                        port:py${python.version}-jinja2 \
     43                        port:py${python.version}-yaml \
     44                        port:py${python.version}-setuptools \
     45                        port:py${python.version}-cryptography \
     46                        port:ansible_select
     47
     48    depends_build-append    port:asciidoc \
     49                            port:libxslt \
     50                            port:docbook-xsl
     51
     52    select.group       ansible
     53    select.file        ${filespath}/py${python.version}-ansible
     54    notes "
     55To make the Python ${python.branch} version of Ansible the one that is run\
     56when you execute the commands without a version suffix, e.g. 'ansible', run:
     57
     58port select --set ${select.group} [file tail ${select.file}]
     59"
     60
     61
     62    livecheck.type  none
     63
     64} else {
     65
     66    livecheck.name  ansible
     67
     68}
  • new file python/py-ansible/files/py27-ansible

    diff --git a/python/py-ansible/files/py27-ansible b/python/py-ansible/files/py27-ansible
    new file mode 100644
    index 0000000000..b262a2587a
    - +  
     1bin/ansible-2.7
     2bin/ansible-config-2.7
     3bin/ansible-connection-2.7
     4bin/ansible-console-2.7
     5bin/ansible-doc-2.7
     6bin/ansible-galaxy-2.7
     7bin/ansible-inventory-2.7
     8bin/ansible-playbook-2.7
     9bin/ansible-pull-2.7
     10bin/ansible-vault-2.7
  • new file python/py-ansible/files/py35-ansible

    diff --git a/python/py-ansible/files/py35-ansible b/python/py-ansible/files/py35-ansible
    new file mode 100644
    index 0000000000..401133e291
    - +  
     1bin/ansible-3.5
     2bin/ansible-config-3.5
     3bin/ansible-connection-3.5
     4bin/ansible-console-3.5
     5bin/ansible-doc-3.5
     6bin/ansible-galaxy-3.5
     7bin/ansible-inventory-3.5
     8bin/ansible-playbook-3.5
     9bin/ansible-pull-3.5
     10bin/ansible-vault-3.5
  • new file python/py-ansible/files/py36-ansible

    diff --git a/python/py-ansible/files/py36-ansible b/python/py-ansible/files/py36-ansible
    new file mode 100644
    index 0000000000..01777304c1
    - +  
     1bin/ansible-3.6
     2bin/ansible-config-3.6
     3bin/ansible-connection-3.6
     4bin/ansible-console-3.6
     5bin/ansible-doc-3.6
     6bin/ansible-galaxy-3.6
     7bin/ansible-inventory-3.6
     8bin/ansible-playbook-3.6
     9bin/ansible-pull-3.6
     10bin/ansible-vault-3.6
  • sysutils/ansible/Portfile

    diff --git a/sysutils/ansible/Portfile b/sysutils/ansible/Portfile
    index 9ecec94d94..cc58cddda5 100644
    a b  
    22
    33PortSystem      1.0
    44PortGroup       python 1.0
    5 PortGroup       github 1.0
    65
    76name            ansible
    87epoch           1
    98categories      sysutils
    109
    11 github.setup    ${name} ${name} 2.3.2.0-1 v
    12 version         [string map {- .} ${version}]
    13 revision        1
    14 fetch.type      git
     10replaced_by     py-ansible
     11distfiles
     12
     13version         2.3.2.0.1
     14revision        2
    1515
    1616maintainers     {adfernandes @adfernandes} blair gmail.com:pedro.salgado
    1717
     18license         BSD
    1819homepage        https://github.com/ansible/ansible
    1920description     SSH-based configuration management and deployment system
    2021long_description \
    long_description \ 
    2425    or daemons to be installed on remote nodes.  Extension modules can \
    2526    be written in any language and are transferred to managed machines \
    2627    automatically.
    27 license         GPL-3+
    2828
    2929platforms       darwin
    3030supported_archs noarch
    3131
    32 python.versions 27
    33 
    34 depends_lib-append      port:py${python.version}-six \
    35                         port:py${python.version}-paramiko \
    36                         port:py${python.version}-httplib2 \
    37                         port:py${python.version}-jinja2 \
    38                         port:py${python.version}-yaml \
    39                         port:py${python.version}-setuptools \
    40                         port:py${python.version}-crypto
    41 
    42 depends_build-append    port:asciidoc \
    43                         port:libxslt \
    44                         port:docbook-xsl
    45 
    46 post-fetch {
    47     # fetch submodules (https://github.com/ansible/ansible/issues/11199)
    48     system -W "${worksrcpath}" "git submodule update --init"
    49 }
    50 
    51 patch {
    52     fs-traverse f ${worksrcpath} {
    53         if {[file isfile ${f}] && ![regexp {\.(bin|ico|png|eot|ttf|woff|reg|gz|zip)$} ${f} match] && ![regexp {\.git} ${f} match] && ![regexp {v2/test/test.yml} ${f} match]} {
    54             reinplace -q "s#/etc/ansible#${prefix}/etc/ansible#g" ${f}
    55             reinplace -q "s#/usr/share/ansible#${prefix}/share/ansible#g" ${f}
    56         }
    57     }
    58 }
    59 
    60 post-build {
    61     system -W "${worksrcpath}" "make docs"
    62 }
    63 
    64 post-destroot {
    65     # Documentation and examples.
    66     xinstall -m 644 -W ${worksrcpath} README.md COPYING \
    67         ${destroot}${prefix}/share/doc/${name}
    68 
    69     xinstall -m 755 -d ${destroot}${prefix}/share/doc/examples
    70     xinstall -m 755 ${worksrcpath}/examples/ansible.cfg \
    71         ${destroot}${prefix}/share/doc/${name}/examples
    72     xinstall -m 755 ${worksrcpath}/examples/hosts \
    73         ${destroot}${prefix}/share/doc/${name}/examples
    74 
    75     # Man pages.
    76     xinstall -m 755 {*}[glob ${worksrcpath}/docs/man/man1/*.1] \
    77         ${destroot}${prefix}/share/man/man1
    78 
    79     # Install sample config and hosts file.
    80     xinstall -m 755 -d ${destroot}${prefix}/etc/ansible
    81     xinstall -b -m 755 ${worksrcpath}/examples/ansible.cfg \
    82         ${destroot}${prefix}/etc/ansible/ansible.cfg.default
    83     xinstall -b -m 755 ${worksrcpath}/examples/hosts \
    84         ${destroot}${prefix}/etc/ansible/hosts.default
     32pre-configure {
     33    ui_error "Please do not install this port since it has been replaced by 'py-ansible'."
     34    ui_error "Both Python-2 and Python-3 are supporteed. Use 'sudo port uninstall ansible'"
     35    ui_error "followed by 'sudo port install py{27|36}-ansible' to install the newest"
     36    ui_error "version, then use 'sudo port select --set ansible py{27|36}-ansible' to"
     37    ui_error "select the default Python runtime for Ansible."
     38    return -code error
    8539}