homebrew-core/Formula/squid.rb

57 lines
1.5 KiB
Ruby
Raw Normal View History

2010-05-06 03:39:30 +00:00
require 'formula'
2012-03-21 03:46:55 +00:00
class NoBdb5 < Requirement
2013-01-20 02:45:59 +00:00
satisfy(:build_env => false) { !Formula.factory("berkeley-db").installed? }
2012-03-21 03:46:55 +00:00
def message; <<-EOS.undent
This software can fail to compile when Berkeley-DB 5.x is installed.
You may need to try:
brew unlink berkeley-db
brew install squid
2012-03-21 03:46:55 +00:00
brew link berkeley-db
EOS
end
end
2011-03-10 05:11:03 +00:00
class Squid < Formula
2010-05-06 03:39:30 +00:00
homepage 'http://www.squid-cache.org/'
url 'http://www.squid-cache.org/Versions/v3/3.2/squid-3.2.5.tar.gz'
sha1 '17c6f03ca90b0918b847e9e34669ba827da7edba'
2010-05-06 03:39:30 +00:00
2013-01-27 22:54:04 +00:00
depends_on NoBdb5
2012-03-21 03:46:55 +00:00
2010-05-06 03:39:30 +00:00
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--localstatedir=#{var}"
system "make install"
end
def 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>#{opt_prefix}/sbin/squid</string>
<string>-N</string>
<string>-d 1</string>
<string>-D</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>#{`whoami`.chomp}</string>
<key>WorkingDirectory</key>
<string>#{var}</string>
</dict>
</plist>
EOS
end
2010-05-06 03:39:30 +00:00
end