Skip to content

Instantly share code, notes, and snippets.

@bodgit
Created August 27, 2011 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bodgit/1175849 to your computer and use it in GitHub Desktop.
Save bodgit/1175849 to your computer and use it in GitHub Desktop.
MacPorts Portfile for Marionette Collective
# -*- 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
# $Id$
PortSystem 1.0
PortGroup ruby 1.0
name mcollective
version 1.2.1
categories net sysutils
platforms darwin
supported_archs noarch
license Apache-2
maintainers nomaintainer
description The Marionette Collective
long_description \
The Marionette Collective AKA MCollective is a framework to build \
server orchestration or parallel job execution systems.
homepage http://www.puppetlabs.com/mcollective/
master_sites http://downloads.puppetlabs.com/mcollective/
checksums md5 6764799f8183f63b099af167abe749d5 \
sha1 ebac6933a1938e3a4aa2933cf0afceb3fa6b5744 \
rmd160 812328307885684697021c20dcd76bbc171105b3
depends_lib port:ruby \
port:rb-stomp
extract.suffix .tgz
use_configure no
build {}
test.run no
post-patch {
# Not 100% sure why I need to change "/usr/bin/env ruby" to "${ruby.bin}"
reinplace "s|#!.*|#!${ruby.bin}|" \
${worksrcpath}/mcollectived.rb
reinplace "s|configfile = \"|&${prefix}|" \
${worksrcpath}/mcollectived.rb
reinplace "s|\\(libdir = \\)/usr|\\1${prefix}|" \
${worksrcpath}/etc/client.cfg.dist \
${worksrcpath}/etc/server.cfg.dist
reinplace "s|plugin.yaml = |&${prefix}|" \
${worksrcpath}/etc/client.cfg.dist \
${worksrcpath}/etc/server.cfg.dist
reinplace "s|logfile = |&${prefix}|" \
${worksrcpath}/etc/server.cfg.dist
reinplace "s|@rpchelptemplate = \"|&${prefix}|" \
${worksrcpath}/lib/mcollective/config.rb
reinplace "s|:configfile\\] \\|\\| \"|&${prefix}|" \
${worksrcpath}/lib/mcollective/rpc.rb
reinplace "s|config = \"|&${prefix}|g" \
${worksrcpath}/lib/mcollective/util.rb
}
destroot.keepdirs ${destroot}${prefix}/etc/mcollective/ssl/clients \
${destroot}${prefix}/etc/mcollective/plugin.d \
${destroot}${prefix}/var/log \
${destroot}${prefix}/var/run
destroot {
xinstall -m 755 -d ${destroot}${ruby.lib}
xinstall -m 755 -d ${destroot}${prefix}/bin
xinstall -m 755 -d ${destroot}${prefix}/sbin
xinstall -m 755 -d ${destroot}${prefix}/libexec/mcollective
xinstall -m 755 -d ${destroot}${prefix}/etc/mcollective
xinstall -m 755 -d ${destroot}${prefix}/etc/mcollective/plugin.d
xinstall -m 755 -d ${destroot}${prefix}/etc/mcollective/ssl/clients
xinstall -m 755 -d ${destroot}${prefix}/var/log
xinstall -m 755 -d ${destroot}${prefix}/var/run
xinstall -m 755 ${worksrcpath}/mcollectived.rb ${destroot}${prefix}/sbin/mcollectived
xinstall -m 640 ${worksrcpath}/etc/server.cfg.dist ${destroot}${prefix}/etc/mcollective/server.cfg
xinstall -m 644 ${worksrcpath}/etc/client.cfg.dist ${destroot}${prefix}/etc/mcollective/client.cfg
xinstall -m 444 ${worksrcpath}/etc/facts.yaml.dist ${destroot}${prefix}/etc/mcollective/facts.yaml
xinstall -m 755 ${worksrcpath}/etc/rpc-help.erb ${destroot}${prefix}/etc/mcollective/rpc-help.erb
eval file copy [glob ${worksrcpath}/lib/*] ${destroot}${ruby.lib}
eval file copy [glob ${worksrcpath}/plugins/*] ${destroot}${prefix}/libexec/mcollective
eval xinstall -m 755 [glob ${worksrcpath}/mc-*] ${destroot}${prefix}/sbin
xinstall -m 755 ${worksrcpath}/mco ${destroot}${prefix}/bin
}
startupitem.create yes
startupitem.name mcollectived
startupitem.executable ${prefix}/sbin/mcollectived --pidfile=${prefix}/var/run/mcollectived.pid --config=${prefix}/etc/mcollective/server.cfg
startupitem.pidfile auto ${prefix}/var/run/mcollectived.pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment