2010-05-06 03:39:30 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-03-21 03:46:55 +00:00
|
|
|
class NoBdb5 < Requirement
|
2014-02-25 06:46:59 +00:00
|
|
|
satisfy(:build_env => false) { !Formula["berkeley-db"].installed? }
|
2013-01-20 02:45:59 +00:00
|
|
|
|
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
|
2012-08-06 14:57:38 +00:00
|
|
|
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/'
|
2013-12-21 17:01:55 +00:00
|
|
|
url 'http://www.squid-cache.org/Versions/v3/3.3/squid-3.3.11.tar.gz'
|
|
|
|
sha1 'e89812a51d4e88abac15c301d571d83549f2d81e'
|
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
|
|
|
|
2013-12-21 17:01:55 +00:00
|
|
|
# fix building on mavericks
|
|
|
|
# http://bugs.squid-cache.org/show_bug.cgi?id=3954
|
|
|
|
def patches; DATA; end if MacOS.version >= :mavericks
|
|
|
|
|
2010-05-06 03:39:30 +00:00
|
|
|
def install
|
2013-05-12 12:36:12 +00:00
|
|
|
# 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
|
2013-11-07 06:19:23 +00:00
|
|
|
args = %W[
|
2013-05-07 12:00:31 +00:00
|
|
|
--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--localstatedir=#{var}
|
|
|
|
--enable-ssl
|
|
|
|
--enable-ssl-crtd
|
2013-05-12 12:36:12 +00:00
|
|
|
--disable-eui
|
2013-06-27 06:57:11 +00:00
|
|
|
--enable-ipfw-transparent
|
2013-05-07 12:00:31 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
system "./configure", *args
|
2010-05-06 03:39:30 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2012-11-14 11:38:23 +00:00
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
def plist; <<-EOS.undent
|
2012-11-14 11:38:23 +00:00
|
|
|
<?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>
|
2012-11-25 15:06:41 +00:00
|
|
|
<string>#{opt_prefix}/sbin/squid</string>
|
2012-11-14 11:38:23 +00:00
|
|
|
<string>-N</string>
|
|
|
|
<string>-d 1</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>WorkingDirectory</key>
|
|
|
|
<string>#{var}</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
2012-11-25 15:06:41 +00:00
|
|
|
EOS
|
2012-11-14 11:38:23 +00:00
|
|
|
end
|
2010-05-06 03:39:30 +00:00
|
|
|
end
|
2013-12-21 17:01:55 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/compat/unsafe.h b/compat/unsafe.h
|
|
|
|
index d58f546..6c9f7ab 100644
|
|
|
|
--- a/compat/unsafe.h
|
|
|
|
+++ b/compat/unsafe.h
|
|
|
|
@@ -5,7 +5,7 @@
|
|
|
|
* Trap unintentional use of functions unsafe for use within squid.
|
|
|
|
*/
|
|
|
|
|
|
|
|
-#if !SQUID_NO_STRING_BUFFER_PROTECT
|
|
|
|
+#if !SQUID_NO_STRING_BUFFER_PROTECT && 0
|
|
|
|
#ifndef sprintf
|
|
|
|
#define sprintf ERROR_sprintf_UNSAFE_IN_SQUID
|
|
|
|
#endif
|
|
|
|
diff --git a/include/Array.h b/include/Array.h
|
|
|
|
index 8cee5fa..8f43522 100644
|
|
|
|
--- a/include/Array.h
|
|
|
|
+++ b/include/Array.h
|
|
|
|
@@ -35,6 +35,7 @@
|
|
|
|
\todo CLEANUP: this file should be called Vector.h at least, and probably be replaced by STL Vector<C>
|
|
|
|
*/
|
|
|
|
|
|
|
|
+#include <iterator>
|
|
|
|
#include "fatal.h"
|
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
@@ -44,7 +45,7 @@
|
|
|
|
/* iterator support */
|
|
|
|
|
|
|
|
template <class C>
|
|
|
|
-class VectorIteratorBase
|
|
|
|
+class VectorIteratorBase : public std::iterator <std::forward_iterator_tag, typename C::value_type>
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|