2010-02-11 22:33:40 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Tcpflow < Formula
|
2012-04-20 12:18:18 +00:00
|
|
|
homepage 'https://github.com/simsong/tcpflow'
|
|
|
|
url 'https://github.com/downloads/simsong/tcpflow/tcpflow-1.2.6.tar.gz'
|
|
|
|
md5 '7562f8a1a65f1ce1238be84a1fe83bf6'
|
2010-02-11 22:33:40 +00:00
|
|
|
|
2012-03-18 03:44:36 +00:00
|
|
|
# Patch from MacPorts
|
|
|
|
def patches; DATA; end
|
2010-02-11 22:33:40 +00:00
|
|
|
|
|
|
|
def install
|
2011-04-08 18:16:37 +00:00
|
|
|
if MacOS.leopard?
|
2010-11-14 23:16:27 +00:00
|
|
|
cp Dir["#{MacOS.xcode_prefix}/usr/share/libtool/config.*"], "."
|
2011-04-08 18:16:37 +00:00
|
|
|
else
|
|
|
|
cp Dir["#{MacOS.xcode_prefix}/usr/share/libtool/config/config.*"], "."
|
2010-11-14 23:16:27 +00:00
|
|
|
end
|
2010-04-19 01:06:07 +00:00
|
|
|
|
2012-04-20 12:18:18 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
2012-03-18 03:44:36 +00:00
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--mandir=#{man}"
|
2010-02-11 22:33:40 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
2012-04-20 12:18:18 +00:00
|
|
|
--- a/src/tcpip.cpp
|
|
|
|
+++ b/src/tcpip.cpp
|
|
|
|
@@ -541,6 +541,12 @@ unsigned int tcpdemux::get_max_fds(void)
|
|
|
|
perror("getrlimit");
|
2012-02-07 03:51:27 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
2012-04-20 12:18:18 +00:00
|
|
|
+
|
2010-02-11 22:33:40 +00:00
|
|
|
+#if defined(__APPLE__)
|
2012-04-20 12:18:18 +00:00
|
|
|
+ if (limit.rlim_max > OPEN_MAX) {
|
|
|
|
+ limit.rlim_max = OPEN_MAX;
|
|
|
|
+ }
|
2010-02-11 22:33:40 +00:00
|
|
|
+#endif
|
2012-04-20 12:18:18 +00:00
|
|
|
|
2012-02-07 03:51:27 +00:00
|
|
|
/* set the current to the maximum or specified value */
|
|
|
|
if (max_desired_fds) limit.rlim_cur = max_desired_fds;
|