source: trunk/dports/sysutils/salt/Portfile

Last change on this file was 154119, checked in by larryv@…, 13 months ago

salt: Update to 2016.11

Closes: #52671

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.3 KB
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 154119 2016-10-22 03:42:02Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6PortGroup           python 1.0
7
8github.setup        saltstack salt 2016.11 v
9name                salt
10categories          sysutils
11platforms           darwin
12maintainers         gmail.com:jeremy.mcmillan
13license             Apache-2
14supported_archs     noarch
15
16description         Salt is a Python-based remote execution, automation, \
17                    configuration, and orchestration engine.
18
19long_description    SaltStack is fast, scalable and flexible software for data \
20                    center automation, from infrastructure and any cloud, \
21                    to the entire application stack.
22
23homepage            http://saltstack.com/
24
25python.default_version 27
26
27checksums           rmd160 ad958f0c1a1bb0656ce401e06533a5f60b43fe72 \
28                    sha256 d277570404bdd53bc883847f1ebdd2686d1b23f428ceb735006d2cddc5b15b79
29
30depends_build       port:py${python.version}-setuptools
31
32depends_lib-append  port:py${python.version}-crypto \
33                    port:py${python.version}-jinja2 \
34                    port:py${python.version}-msgpack \
35                    port:py${python.version}-pip \
36                    port:py${python.version}-yaml \
37                    port:py${python.version}-tornado \
38                    port:py${python.version}-zmq \
39                    port:swig-python
40
41startupitem.create        yes
42startupitem.name          salt-minion
43startupitem.netchange     yes
44startupitem.logevents     yes
45startupitem.logfile       ${prefix}/var/log/salt/minion
46startupitem.executable    ${prefix}/bin/salt-minion
47
48
49
50post-activate {
51
52    file mkdir ${prefix}/etc/salt
53
54    if ![file exists /etc/salt] {
55        ln -s ${prefix}/etc/salt /etc/salt
56    }
57
58    if ![file exists ${prefix}/etc/salt/minion] {
59        copy ${worksrcpath}/conf/minion ${prefix}/etc/salt
60    }
61
62    if ![file exists ${prefix}/etc/salt/master] {
63        copy ${worksrcpath}/conf/master ${prefix}/etc/salt
64    }
65}
66
67post-destroot {
68
69    if ![file exists ${destroot}/Library/LaunchDaemons] {
70        file mkdir ${destroot}/Library/LaunchDaemons
71    }
72    copy ${worksrcpath}/pkg/osx/scripts/com.saltstack.salt.master.plist \
73        ${destroot}/Library/LaunchDaemons/org.macports.salt-master.plist
74    reinplace -W ${destroot}/Library/LaunchDaemons \
75        "s|/opt/salt/bin/start-salt-master.sh|${prefix}/bin/salt-master|g" org.macports.salt-master.plist
76    reinplace -W ${destroot}/Library/LaunchDaemons \
77        "s|com.saltstack.salt.master|org.macports.salt-master|g" org.macports.salt-master.plist
78    copy ${worksrcpath}/pkg/osx/scripts/com.saltstack.salt.api.plist \
79        ${destroot}/Library/LaunchDaemons/org.macports.salt-api.plist
80    reinplace -W ${destroot}/Library/LaunchDaemons \
81        "s|/opt/salt/bin/start-salt-api.sh|${prefix}/bin/salt-api|g" org.macports.salt-api.plist
82    reinplace -W ${destroot}/Library/LaunchDaemons \
83        "s|com.saltstack.salt.api|org.macports.salt-api|g" org.macports.salt-api.plist
84    copy ${worksrcpath}/pkg/osx/scripts/com.saltstack.salt.syndic.plist \
85        ${destroot}/Library/LaunchDaemons/org.macports.salt-syndic.plist
86    reinplace -W ${destroot}/Library/LaunchDaemons \
87        "s|/opt/salt/bin/start-salt-syndic.sh|${prefix}/bin/salt-syndic|g" org.macports.salt-syndic.plist
88    reinplace -W ${destroot}/Library/LaunchDaemons \
89        "s|com.saltstack.salt.syndic|org.macports.salt-syndic|g" org.macports.salt-syndic.plist
90
91}
92
93pre-deactivate {
94
95    if { [file type /etc/salt] == "link" } {
96        file delete /etc/salt
97    }
98
99}
100
101notes "
102This port configures a LaunchItem for salt-minion.
103
104It also installs LaunchItems for the salt-master, api, and the salt-syndic.
105
106To start the salt-master, api, or syndic via launchd, run
107
108sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-master.plist
109sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-api.plist
110sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-syndic.plist
111
112or to start on El Capitan (10.11) or later system
113
114sudo launchctl enable system/org.macports.salt-master
115sudo launchctl bootstrap system /Library/LaunchDaemons/org.macports.salt-master.plist
116sudo launchctl enable system/org.macports.salt-api
117sudo launchctl bootstrap system /Library/LaunchDaemons/org.macports.salt-api.plist
118sudo launchctl enable system/org.macports.salt-syndic
119sudo launchctl bootstrap system /Library/LaunchDaemons/org.macports.salt-syndic.plist
120
121To disable launchd management for the master or syndic, run the appropriate
122unload command:
123
124sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-master.plist
125sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-api.plist
126sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-syndic.plist
127
128or to disable on El Capitan (10.11) or later system
129
130sudo launchctl disable system/org.macports.salt-master
131sudo launchctl bootout system /Library/LaunchDaemons/org.macports.salt-master.plist
132sudo launchctl disable system/org.macports.salt-api
133sudo launchctl bootout system /Library/LaunchDaemons/org.macports.salt-api.plist
134sudo launchctl disable system/org.macports.salt-syndic
135sudo launchctl bootout system /Library/LaunchDaemons/org.macports.salt-syndic.plist
136
137"
138
Note: See TracBrowser for help on using the repository browser.