#!/bin/bash MPATH="$1" BETCDIR='/etc/mcollective' BRUBYDIR='/Library/Ruby/Site/1.8' BSBINDIR='/usr/sbin' BBINDIR='/usr/bin' BLIBEXECDIR='/usr/libexec/mcollective' BDOCDIR='/usr/share/doc/mcollective' BLAUNCHDIR='/Library/LaunchDaemons' BLOGDIR='/var/log/mcollective' PACKAGEMAKER='/Applications/PackageMaker.app/Contents/MacOS/PackageMaker' if [ -z $MPATH ]; then echo 'Please give the path to the MCollective source directory' exit 1 fi msg_stomp() { echo "It is recommended to install stomp on this system using ruby gems" exit 2 } msg_xcode() { echo 'It is required to have the latest XCode installed' exit 3 } # Make sure we have stomp so we can load mcollective /usr/bin/ruby < $tmpdir/$BLAUNCHDIR/org.marionette-collective.mcollective.plist < EnvironmentVariables PATH /sbin:/usr/sbin:/bin:/usr/bin RUBYLIB /Library/Ruby/Site/1.8 Label org.marionette-collective.mcollective OnDemand KeepAlive ProgramArguments /usr/sbin/mcollectived --config=/etc/mcollective/server.cfg RunAtLoad ServiceDescription MCollective Server ServiceIPC EOF #Make our Packages. This requires XCode be installed $PACKAGEMAKER -r $tmpdir --version $mcversion --title "MCollective" -l / -o $pkgdir/MCollective_$mcversion.pkg -i org.marionette-collective.mcollective $PACKAGEMAKER -r $common_tmpdir --version $mcversion --title "MCollective Common" -l / -o $pkgdir/MCollective-Common_$mcversion.pkg -i org.marionette-collective.mcollective-common $PACKAGEMAKER -r $client_tmpdir --version $mcversion --title "MCollective Client" -l / -o $pkgdir/MCollective-Client_$mcversion.pkg -i org.marionette-collective.mcollective-client # Make sure that we install the stomp gem, this is ugly and should be part of the package cat - > $pkgdir/MCollective-Common_$mcversion.pkg/Contents/Resources/postflight < $pkgdir/MCollective_$mcversion.pkg/Contents/Resources/postflight <