#!/bin/bash MPATH='' 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' if [ -z $1 ]; then echo 'Please give the path to the MCollective source directory' exit 1 else MPATH=$1 fi function msg_stomp { echo 'It is recommended to install stomp on this system using ruby gems' exit 2 } function 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 #launchd complains if the permissions aren't right chmod 644 $tmpdir/$BLAUNCHDIR/org.marionette-collective.mcollective.plist #Make our Packages. This requires XCode be installed /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -r $tmpdir --version $mcversion --title "MCollective" -l / -o MCollective_$mcversion.pkg -i org.marionette-collective.mcollective /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -r $common_tmpdir --version $mcversion --title "MCollective Common" -l / -o MCollective-Common_$mcversion.pkg -i org.marionette-collective.mcollective-common /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -r $client_tmpdir --version $mcversion --title "MCollective Client" -l / -o MCollective-Client_$mcversion.pkg -i org.marionette-collective.mcollective-client #Clean up rm -rf $tmpdir rm -rf $common_tmpdir rm -rf $client_tmpdir