Ticket #30998: Portfile

File Portfile, 3.9 KB (added by matt@…, 13 years ago)

Portfile for Marionette Collective

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$
3
4PortSystem              1.0
5PortGroup               ruby 1.0
6
7name                    mcollective
8version                 1.2.1
9categories              net sysutils
10platforms               darwin
11supported_archs         noarch
12license                 Apache-2
13maintainers             nomaintainer
14description             The Marionette Collective
15long_description        \
16    The Marionette Collective AKA MCollective is a framework to build \
17    server orchestration or parallel job execution systems.
18homepage                http://www.puppetlabs.com/mcollective/
19master_sites            http://downloads.puppetlabs.com/mcollective/
20
21checksums               md5     6764799f8183f63b099af167abe749d5 \
22                        sha1    ebac6933a1938e3a4aa2933cf0afceb3fa6b5744 \
23                        rmd160  812328307885684697021c20dcd76bbc171105b3
24
25depends_lib             port:ruby \
26                        port:rb-stomp
27
28extract.suffix          .tgz
29use_configure           no
30build                   {}
31test.run                no
32
33post-patch {
34    # Not 100% sure why I need to change "/usr/bin/env ruby" to "${ruby.bin}"
35    reinplace "s|#!.*|#!${ruby.bin}|" \
36        ${worksrcpath}/mcollectived.rb
37    reinplace "s|configfile = \"|&${prefix}|" \
38        ${worksrcpath}/mcollectived.rb
39
40    reinplace "s|\\(libdir = \\)/usr|\\1${prefix}|" \
41        ${worksrcpath}/etc/client.cfg.dist \
42        ${worksrcpath}/etc/server.cfg.dist
43    reinplace "s|plugin.yaml = |&${prefix}|" \
44        ${worksrcpath}/etc/client.cfg.dist \
45        ${worksrcpath}/etc/server.cfg.dist
46    reinplace "s|logfile = |&${prefix}|" \
47        ${worksrcpath}/etc/server.cfg.dist
48
49    reinplace "s|@rpchelptemplate = \"|&${prefix}|" \
50        ${worksrcpath}/lib/mcollective/config.rb
51
52    reinplace "s|:configfile\\] \\|\\| \"|&${prefix}|" \
53        ${worksrcpath}/lib/mcollective/rpc.rb
54
55    reinplace "s|config = \"|&${prefix}|g" \
56        ${worksrcpath}/lib/mcollective/util.rb
57}
58
59destroot.keepdirs       ${destroot}${prefix}/etc/mcollective/ssl/clients \
60                        ${destroot}${prefix}/etc/mcollective/plugin.d \
61                        ${destroot}${prefix}/var/log \
62                        ${destroot}${prefix}/var/run
63
64destroot {
65    xinstall -m 755 -d ${destroot}${ruby.lib}
66    xinstall -m 755 -d ${destroot}${prefix}/bin
67    xinstall -m 755 -d ${destroot}${prefix}/sbin
68    xinstall -m 755 -d ${destroot}${prefix}/libexec/mcollective
69    xinstall -m 755 -d ${destroot}${prefix}/etc/mcollective
70    xinstall -m 755 -d ${destroot}${prefix}/etc/mcollective/plugin.d
71    xinstall -m 755 -d ${destroot}${prefix}/etc/mcollective/ssl/clients
72    xinstall -m 755 -d ${destroot}${prefix}/var/log
73    xinstall -m 755 -d ${destroot}${prefix}/var/run
74
75    xinstall -m 755 ${worksrcpath}/mcollectived.rb ${destroot}${prefix}/sbin/mcollectived
76    xinstall -m 640 ${worksrcpath}/etc/server.cfg.dist ${destroot}${prefix}/etc/mcollective/server.cfg
77    xinstall -m 644 ${worksrcpath}/etc/client.cfg.dist ${destroot}${prefix}/etc/mcollective/client.cfg
78    xinstall -m 444 ${worksrcpath}/etc/facts.yaml.dist ${destroot}${prefix}/etc/mcollective/facts.yaml
79    xinstall -m 755 ${worksrcpath}/etc/rpc-help.erb ${destroot}${prefix}/etc/mcollective/rpc-help.erb
80
81    eval file copy [glob ${worksrcpath}/lib/*] ${destroot}${ruby.lib}
82    eval file copy [glob ${worksrcpath}/plugins/*] ${destroot}${prefix}/libexec/mcollective
83    eval xinstall -m 755 [glob ${worksrcpath}/mc-*] ${destroot}${prefix}/sbin
84    xinstall -m 755 ${worksrcpath}/mco ${destroot}${prefix}/bin
85}
86
87startupitem.create      yes
88startupitem.name        mcollectived
89startupitem.executable  ${prefix}/sbin/mcollectived --pidfile=${prefix}/var/run/mcollectived.pid --config=${prefix}/etc/mcollective/server.cfg
90startupitem.pidfile     auto ${prefix}/var/run/mcollectived.pid