Ticket #44300: Portfile

File Portfile, 3.8 KB (added by cro (C. R. Oldham), 10 years ago)

Portfile for Salt

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           python 1.0
6
7name                salt
8version             2014.1.7
9categories          sysutils
10platforms           darwin
11maintainers         saltstack.com:cr
12license             Apache-2
13supported_archs     noarch
14
15description         Salt is a Python-based remote execution, automation, \
16                    configuration, and orchestration engine.
17
18long_description    SaltStack is fast, scalable and flexible software for data \
19                    center automation, from infrastructure and any cloud, \
20                    to the entire application stack.
21
22homepage            http://docs.saltstack.com/
23fetch.type          git
24git.url             git://github.com/saltstack/salt.git
25git.branch          v2014.1.7
26
27# master_sites        https://pypi.python.org/packages/source/s/salt/
28
29# checksums           rmd160  4ca8aedca823f4e6d5711ee78777d46036d77a44 \
30#                    sha256  bc501c50cef7af9ce857b6f4a7c34b0238cc6a2810e4bd6e3ff7e0bfb082343f
31
32python.default_version 27
33python.link_binaries_suffix
34
35depends_build       port:py${python.version}-setuptools
36
37depends_lib-append  port:py${python.version}-crypto \
38                    port:py${python.version}-m2crypto \
39                    port:py${python.version}-msgpack \
40                    port:py${python.version}-pip \
41                    port:py${python.version}-yaml \
42                    port:py${python.version}-zmq \
43                    port:swig-python
44
45livecheck.type      regex
46livecheck.regex     {topics/releases/([0-9]+\.[0-9]+\.[0-9]+)\.html}
47
48variant minion {
49    startupitem.create        yes
50    startupitem.name          salt-minion
51    startupitem.netchange     yes
52    startupitem.logevents     yes
53    startupitem.logfile       ${prefix}/var/log/salt/minion
54    startupitem.executable    ${prefix}/bin/salt-minion
55
56    if ![file exists /opt/local/etc/salt/minion] {
57        file copy ${worksrcpath}/conf/minion /opt/local/etc/salt
58    }
59}
60
61variant master {
62
63    post-destroot {
64        file mkdir /opt/local/etc/salt
65        if ![file exists /opt/local/etc/salt/master] {
66            file copy ${worksrcpath}/conf/master /opt/local/etc/salt
67        }
68
69        if ![file exists /etc/salt] {
70            file link /etc/salt /opt/local/etc/salt
71        }
72        file delete /Library/LaunchDaemons/com.saltstack.salt.master.plist
73
74        file copy ${worksrcpath}/pkg/darwin/com.saltstack.salt.master.plist /Library/LaunchDaemons
75
76        reinplace "s|/usr/local|${prefix}|g" /Library/LaunchDaemons/com.saltstack.salt.master.plist
77    }
78    notes-append "
79This variant is for the salt-master.  To start the salt-master via launchd, run
80   
81sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.master.plist
82
83To disable launchd management, run
84
85sudo launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.master.plist
86
87"
88}
89
90variant syndic {
91
92    post-destroot {
93        file delete /Library/LaunchDaemons/com.saltstack.salt.syndic.plist
94        file copy ${worksrcpath}/pkg/darwin/com.saltstack.salt.syndic.plist /Library/LaunchDaemons
95        reinplace "s|/usr/local|${prefix}|g" /Library/LaunchDaemons/com.saltstack.salt.syndic.plist
96    }
97
98    notes-append "
99This variant is for the salt-syndic.  To start the salt-syndic via launchd, run
100   
101sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-syndic.plist
102
103To disable launchd management, run
104
105sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-syndic.plist
106
107"
108}
109
110post-destroot {
111    file mkdir /opt/local/etc/salt
112
113    if ![file exists /etc/salt] {
114        file link /etc/salt /opt/local/etc/salt
115    }
116}
117
118