From ae82cb97237b016d8405ad990ba7899caf12224f Mon Sep 17 00:00:00 2001 From: "Andrew J. Erickson" Date: Sun, 6 Nov 2011 14:59:08 -0800 Subject: [PATCH] vsftpd: allow building with openssl via option Closes Homebrew/homebrew#8476. Signed-off-by: Charlie Sharpsteen --- Formula/vsftpd.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Formula/vsftpd.rb b/Formula/vsftpd.rb index c85fd8f2ed..29a92b5669 100644 --- a/Formula/vsftpd.rb +++ b/Formula/vsftpd.rb @@ -5,10 +5,20 @@ class Vsftpd < Formula md5 '2ea5d19978710527bb7444d93b67767a' homepage 'https://security.appspot.com/vsftpd.html' + def options + [ + ["--openssl", "build with OpenSSL"], + ] + end + # Patch so vsftpd doesn't depend on UTMPX, and can't find OS X's PAM library. def patches; DATA; end def install + if ARGV.include? "--openssl" + inreplace "builddefs.h", "#undef VSF_BUILD_SSL", "#define VSF_BUILD_SSL" + end + inreplace "defs.h", "/etc/vsftpd.conf", "#{etc}/vsftpd.conf" inreplace "tunables.c", "/etc", etc inreplace "tunables.c", "/var", var @@ -19,6 +29,15 @@ class Vsftpd < Formula man5.install "vsftpd.conf.5" man8.install "vsftpd.8" end + + def caveats + if ARGV.include? "--openssl" + return <<-EOD.undent + vsftpd was compiled with SSL support. To use it you must generate a SSL + certificate and set 'enable_ssl=YES' in your config file. + EOD + end + end end __END__