2013-01-16 17:53:24 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Peervpn < Formula
|
|
|
|
homepage "http://www.peervpn.net"
|
|
|
|
url "http://www.peervpn.net/files/peervpn-0-029.tar.gz"
|
|
|
|
version "0.029"
|
|
|
|
sha1 "ebe2214aa002de2a7c1c69f257f8113c2b6ac8a7"
|
|
|
|
|
|
|
|
depends_on "tuntap"
|
|
|
|
|
2013-09-20 18:51:35 +00:00
|
|
|
def patches; DATA; end if MacOS.version == :snow_leopard
|
2013-01-16 17:53:24 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
system "make"
|
|
|
|
bin.install "peervpn"
|
2013-10-07 14:16:45 +00:00
|
|
|
etc.install "peervpn.conf"
|
2013-01-16 17:53:24 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To configure PeerVPN, edit:
|
|
|
|
#{etc}/peervpn.conf
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def test
|
|
|
|
system "#{bin}/peervpn"
|
|
|
|
end
|
|
|
|
end
|
2013-09-20 18:51:35 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/platform/io.c b/platform/io.c
|
|
|
|
index 209666a..0a6c2cf 100644
|
|
|
|
--- a/platform/io.c
|
|
|
|
+++ b/platform/io.c
|
|
|
|
@@ -24,6 +24,16 @@
|
|
|
|
#if defined(__FreeBSD__)
|
|
|
|
#define IO_BSD
|
|
|
|
#elif defined(__APPLE__)
|
|
|
|
+size_t strnlen(const char *s, size_t maxlen)
|
|
|
|
+{
|
|
|
|
+ size_t len;
|
|
|
|
+
|
|
|
|
+ for (len = 0; len < maxlen; len++, s++) {
|
|
|
|
+ if (!*s)
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ return (len);
|
|
|
|
+}
|
|
|
|
#define IO_BSD
|
|
|
|
#define IO_USE_SELECT
|
|
|
|
#elif defined(WIN32)
|