Ticket #37897: Portfile

File Portfile, 2.3 KB (added by jcftang@…, 12 years ago)
Line 
1# $Id$
2
3PortSystem         1.0
4PortGroup          python27 1.0
5
6name               ansible
7version            devel
8categories         python
9platforms          darwin
10supported_archs    noarch
11license            GPL-3
12maintainers        nomaintainer
13
14description        Model-driven configuration management, multi-node deployment, and remote task execution system.
15long_description   Ansible is a radically simple configuration-management, deployment, task-execution, and multinode orchestration framework.
16
17homepage           http://www.ansible.cc
18
19fetch.type         git
20git.url            https://github.com/ansible/ansible.git
21git.branch         ${version}
22
23depends_lib-append port:py27-yaml \
24                   port:py27-paramiko \
25                   port:py27-jinja2
26
27python.link_binaries_suffix
28
29post-patch {
30  reinplace "s|/usr/share/ansible|${prefix}/share/ansible|g" ${worksrcpath}/lib/ansible/constants.py ${worksrcpath}/examples/ansible.cfg
31  reinplace "s|/etc/ansible/ansible.cfg|${prefix}/etc/ansible/ansible.cfg|g" ${worksrcpath}/lib/ansible/constants.py ${worksrcpath}/examples/ansible.cfg
32  reinplace "s|/etc/ansible/hosts|${prefix}/etc/ansible/hosts|g" ${worksrcpath}/lib/ansible/constants.py ${worksrcpath}/examples/ansible.cfg
33  reinplace "s|/usr/share/ansible_plugins|${prefix}/${prefix}/share/ansible_plugins|g" ${worksrcpath}/lib/ansible/constants.py ${worksrcpath}/examples/ansible.cfg
34}
35
36post-destroot {
37  xinstall -m 644 -W ${worksrcpath} README.md CHANGELOG.md CONTRIBUTING.md COPYING  \
38    ${destroot}${prefix}/share/doc/${name}
39
40  xinstall -m 755 -d ${destroot}${prefix}/share/doc/examples
41  xinstall -m 755 ${worksrcpath}/examples/ansible.cfg ${destroot}${prefix}/share/doc/${name}/examples
42  xinstall -m 755 ${worksrcpath}/examples/ansible.cfg ${worksrcpath}/examples/hosts ${destroot}${prefix}/share/doc/${name}/examples
43  file copy ${worksrcpath}/examples/playbooks ${destroot}${prefix}/share/doc/${name}/examples/
44
45  xinstall -d 644 ${destroot}${prefix}/share/man/man1
46  eval xinstall -m 755 [glob ${worksrcpath}/docs/man/man1/*] ${destroot}${prefix}/share/man/man1
47
48  # install sample config and hosts file
49  xinstall -m 755 -d ${destroot}${prefix}/etc/ansible
50  xinstall -m 755 ${worksrcpath}/examples/ansible.cfg ${destroot}${prefix}/etc/ansible/ansible.cfg
51  xinstall -m 755 ${worksrcpath}/examples/hosts ${destroot}${prefix}/etc/ansible/hosts
52}