2011-03-12 16:27:55 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Staticrouted < Formula
|
|
|
|
url 'http://alastairs-place.net/stuff/staticrouted.tar.bz2'
|
|
|
|
homepage 'http://lists.apple.com/archives/macos-x-server/2010/Jul/msg00220.html'
|
|
|
|
version '1.0.1'
|
|
|
|
md5 '1f76b4f15d3bc332d40732bde154a20e'
|
|
|
|
|
2012-08-24 20:40:24 +00:00
|
|
|
depends_on :xcode # For working xcodebuild.
|
|
|
|
|
2011-03-12 16:27:55 +00:00
|
|
|
def install
|
|
|
|
system "xcodebuild SYMROOT=build -target Everything"
|
|
|
|
sbin.install ["build/Release/staticroute", "build/Release/staticrouted"]
|
|
|
|
man8.install ["staticroute.8", "staticrouted.8"]
|
|
|
|
prefix.install "com.coriolis-systems.staticrouted.plist"
|
2011-09-02 21:41:57 +00:00
|
|
|
(prefix+"com.coriolis-systems.staticrouted.plist").chmod 0644
|
2011-03-12 16:27:55 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
If this is your first install, automatically load on login with:
|
2011-10-18 17:01:52 +00:00
|
|
|
sudo mkdir -p /Library/LaunchDaemons
|
|
|
|
sudo cp #{prefix}/com.coriolis-systems.staticrouted.plist /Library/LaunchDaemons/
|
|
|
|
sudo launchctl load -w /Library/LaunchDaemons/com.coriolis-systems.staticrouted.plist
|
2011-03-12 16:27:55 +00:00
|
|
|
|
|
|
|
If this is an upgrade and you already have the com.coriolis-systems.staticrouted.plist loaded:
|
2011-10-18 17:01:52 +00:00
|
|
|
sudo launchctl unload -w /Library/LaunchDaemons/com.coriolis-systems.staticrouted.plist
|
|
|
|
sudo cp #{prefix}/com.coriolis-systems.staticrouted.plist /Library/LaunchDaemons/
|
|
|
|
sudo launchctl load -w /Library/LaunchDaemons/com.coriolis-systems.staticrouted.plist
|
2011-03-12 16:27:55 +00:00
|
|
|
|
|
|
|
Or start it manually:
|
2011-10-18 17:01:52 +00:00
|
|
|
sudo staticrouted
|
2011-03-12 16:27:55 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|