Ticket #45959: Portfile

File Portfile, 3.3 KB (added by cro (C. R. Oldham), 9 years ago)

Portfile for Salt 2014.7.0

Line 
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# $Id: Portfile 112969 2013-11-05 19:09:52Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6PortGroup           python 1.0
7
8github.setup        saltstack salt 2014.7.0 v
9name                salt
10categories          sysutils
11platforms           darwin
12maintainers         saltstack.com:cr
13license             Apache-2
14supported_archs     noarch
15distname            v2014.7.0
16
17description         Salt is a Python-based remote execution, automation, \
18                    configuration, and orchestration engine.
19
20long_description    SaltStack is fast, scalable and flexible software for data \
21                    center automation, from infrastructure and any cloud, \
22                    to the entire application stack.
23
24homepage            http://saltstack.com/
25
26python.default_version 27
27
28checksums           rmd160 f6a9707642ee97a86732d24e6962251b80d6b6fa \
29                    sha256 f64fc33329abac41bc787de8fb17f0b59c5c0fd95da3f6a03600e606f28620f8
30
31depends_build       port:py${python.version}-setuptools
32
33depends_lib-append  port:py${python.version}-crypto \
34                    port:py${python.version}-m2crypto \
35                    port:py${python.version}-jinja2 \
36                    port:py${python.version}-msgpack \
37                    port:py${python.version}-pip \
38                    port:py${python.version}-yaml \
39                    port:py${python.version}-zmq \
40                    port:swig-python
41
42startupitem.create        yes
43startupitem.name          salt-minion
44startupitem.netchange     yes
45startupitem.logevents     yes
46startupitem.logfile       ${prefix}/var/log/salt/minion
47startupitem.executable    ${prefix}/bin/salt-minion
48
49variant raet description {Enable the RAET transport for Salt.} {
50    depends_lib-append port:py${python.version}-raet
51}
52
53post-activate {
54
55    file mkdir ${prefix}/etc/salt
56
57    if ![file exists /etc/salt] {
58        ln -s ${prefix}/etc/salt /etc/salt
59    }
60
61    if ![file exists ${prefix}/etc/salt/minion] {
62        copy ${worksrcpath}/conf/minion ${prefix}/etc/salt
63    }
64
65    if ![file exists ${prefix}/etc/salt/master] {
66        copy ${worksrcpath}/conf/master ${prefix}/etc/salt
67    }
68}
69
70destroot {
71
72    if ![file exists ${destroot}/Library/LaunchDaemons] {
73        file mkdir ${destroot}/Library/LaunchDaemons
74    }
75    copy ${worksrcpath}/pkg/darwin/com.saltstack.salt.master.plist ${destroot}/Library/LaunchDaemons
76    copy ${worksrcpath}/pkg/darwin/com.saltstack.salt.syndic.plist ${destroot}/Library/LaunchDaemons
77
78}
79
80pre-deactivate {
81
82    if { [file type /etc/salt] == "link" } {
83        file delete /etc/salt
84    }
85
86}
87
88notes "
89This port configures a LaunchItem for salt-minion.
90
91It also installs LaunchItems for the salt-master and the salt-syndic.
92
93To start the salt-master via launchd, run
94   
95sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.master.plist
96
97To start the salt-syndic via launchd, run
98
99sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.syndic.plist
100
101To disable launchd management for the master or syndic, run the appropriate
102unload command:
103
104sudo launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.master.plist
105or
106sudo launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.syndic.plist
107
108"
109