2010-01-30 21:58:45 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Vpnc < Formula
|
2010-01-30 21:58:45 +00:00
|
|
|
homepage 'http://www.unix-ag.uni-kl.de/~massar/vpnc/'
|
2012-08-25 16:43:05 +00:00
|
|
|
url 'http://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-0.5.3.tar.gz'
|
2010-01-30 21:58:45 +00:00
|
|
|
sha256 '46cea3bd02f207c62c7c6f2f22133382602baeda1dc320747809e94881414884'
|
|
|
|
|
|
|
|
depends_on 'libgcrypt'
|
|
|
|
depends_on 'libgpg-error'
|
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2334
|
|
|
|
end
|
2011-03-21 21:24:22 +00:00
|
|
|
|
2012-08-25 16:43:05 +00:00
|
|
|
option "hybrid", "Use vpnc hybrid authentication"
|
2010-01-30 21:58:45 +00:00
|
|
|
|
2011-07-31 16:48:02 +00:00
|
|
|
# Patch from user @Imagesafari to enable compilation on Lion
|
|
|
|
def patches
|
|
|
|
DATA if MacOS.lion?
|
|
|
|
end
|
|
|
|
|
2010-01-30 21:58:45 +00:00
|
|
|
def install
|
2010-04-07 05:58:35 +00:00
|
|
|
ENV.no_optimization
|
2010-01-30 21:58:45 +00:00
|
|
|
ENV.deparallelize
|
|
|
|
|
|
|
|
inreplace ["vpnc-script.in", "vpnc-disconnect"] do |s|
|
|
|
|
s.gsub! "/var/run/vpnc", (var + 'run/vpnc')
|
|
|
|
end
|
|
|
|
|
|
|
|
inreplace "vpnc.8.template" do |s|
|
|
|
|
s.gsub! "/etc/vpnc", (etc + 'vpnc')
|
|
|
|
end
|
|
|
|
|
|
|
|
inreplace "Makefile" do |s|
|
|
|
|
s.change_make_var! "PREFIX", prefix
|
|
|
|
s.change_make_var! "ETCDIR", (etc + 'vpnc')
|
|
|
|
|
2012-08-25 16:43:05 +00:00
|
|
|
s.gsub! /^#OPENSSL/, "OPENSSL" if build.include? "hybrid"
|
2010-01-30 21:58:45 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
inreplace "config.c" do |s|
|
|
|
|
s.gsub! "/etc/vpnc", (etc + 'vpnc')
|
|
|
|
s.gsub! "/var/run/vpnc", (var + 'run/vpnc')
|
|
|
|
end
|
|
|
|
|
|
|
|
system "make"
|
|
|
|
(var + 'run/vpnc').mkpath
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
def caveats; <<-EOS
|
|
|
|
To use vpnc hybrid authentification:
|
2010-01-30 21:58:45 +00:00
|
|
|
brew install vpnc --hybrid
|
2010-04-07 05:58:35 +00:00
|
|
|
EOS
|
2010-01-30 21:58:45 +00:00
|
|
|
end
|
|
|
|
end
|
2011-07-31 16:48:02 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
--- vpnc-0.5.3/sysdep.h 2008-11-19 15:36:12.000000000 -0500
|
|
|
|
+++ vpnc-0.5.3.patched/sysdep.h 2011-07-14 12:49:18.000000000 -0400
|
|
|
|
@@ -109,6 +109,7 @@
|
|
|
|
#define HAVE_FGETLN 1
|
|
|
|
#define HAVE_UNSETENV 1
|
|
|
|
#define HAVE_SETENV 1
|
|
|
|
+#define HAVE_GETLINE 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/***************************************************************************/
|