Freeswitch 1.0.6

Closes Homebrew/homebrew#10578.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Mark Quezada 2012-02-28 13:38:05 -10:00 committed by Adam Vandenberg
parent 7063ddb27f
commit 306708ab30

77
Formula/freeswitch.rb Normal file
View file

@ -0,0 +1,77 @@
require 'formula'
class Freeswitch < Formula
homepage 'http://freeswitch.org'
url 'git://git.freeswitch.org/freeswitch.git', :tag => 'v1.0.6'
version '1.0.6'
head 'git://git.freeswitch.org/freeswitch.git'
depends_on 'pkg-config' => :build
depends_on 'jpeg'
if MacOS.xcode_version >= "4.3"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
def install
system "./bootstrap.sh -j#{ENV.make_jobs}"
system "./configure", "--disable-dependency-tracking",
"--enable-shared",
"--enable-static",
"--prefix=#{prefix}",
"--exec_prefix=#{prefix}"
system "make"
system "make install"
plist_path.write startup_plist
plist_path.chmod 0644
end
def startup_plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{bin}/freeswitch</string>
<string>-nc</string>
<string>-nonat</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<true/>
</dict>
</plist>
EOS
end
def caveats; <<-EOS.undent
If this is your first install, automatically load on login with:
mkdir -p ~/Library/LaunchAgents
cp #{plist_path} ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
If this is an upgrade and you already have the #{plist_path.basename} loaded:
launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename}
cp #{plist_path} ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
Or start it manually:
freeswitch -nc --nonat
EOS
end
def test
system "#{bin}/freeswitch", "-version"
end
end