blob: 1fcabe069836a1286afe587db79c2e4b272e7328 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
 | require "formula"
class Squid < Formula
  homepage "http://www.squid-cache.org/"
  url "http://www.squid-cache.org/Versions/v3/3.4/squid-3.4.9.tar.bz2"
  sha1 "a356cadc324d91c41119f96a7d1a20330866c1ac"
  bottle do
    sha1 "26d026bc8523fed17870fcdd7ef935687208232d" => :yosemite
    sha1 "7fa50fc50e2525175d733068b3fc8c00d72eedf1" => :mavericks
    sha1 "bdae1232126a1aa7a9eec3380d1d95184a2923ed" => :mountain_lion
  end
  depends_on "openssl"
  def install
    # http://stackoverflow.com/questions/20910109/building-squid-cache-on-os-x-mavericks
    ENV.append "LDFLAGS",  "-lresolv"
    # For --disable-eui, see:
    # http://squid-web-proxy-cache.1019090.n4.nabble.com/ERROR-ARP-MAC-EUI-operations-not-supported-on-this-operating-system-td4659335.html
    args = %W[
      --disable-debug
      --disable-dependency-tracking
      --prefix=#{prefix}
      --localstatedir=#{var}
      --enable-ssl
      --enable-ssl-crtd
      --disable-eui
      --enable-pf-transparent
      --with-included-ltdl
    ]
    system "./configure", *args
    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_sbin}/squid</string>
        <string>-N</string>
        <string>-d 1</string>
      </array>
      <key>RunAtLoad</key>
      <true/>
      <key>WorkingDirectory</key>
      <string>#{var}</string>
    </dict>
    </plist>
    EOS
  end
end
 |