2010-09-09 05:56:24 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Vsftpd < Formula
|
2011-08-21 17:05:32 +00:00
|
|
|
homepage 'https://security.appspot.com/vsftpd.html'
|
2012-08-25 16:39:16 +00:00
|
|
|
url 'https://security.appspot.com/downloads/vsftpd-2.3.4.tar.gz'
|
|
|
|
sha1 'b774cc6b4c50e20f4fe9ca7f6aa74169ce7fe5ea'
|
2010-09-09 05:56:24 +00:00
|
|
|
|
2012-08-25 16:39:16 +00:00
|
|
|
option "openssl", "Build with OpenSSL"
|
2011-11-06 22:59:08 +00:00
|
|
|
|
2010-10-07 03:14:58 +00:00
|
|
|
# Patch so vsftpd doesn't depend on UTMPX, and can't find OS X's PAM library.
|
|
|
|
def patches; DATA; end
|
|
|
|
|
2010-09-09 05:56:24 +00:00
|
|
|
def install
|
2012-08-25 16:39:16 +00:00
|
|
|
if build.include? "openssl"
|
2011-11-06 22:59:08 +00:00
|
|
|
inreplace "builddefs.h", "#undef VSF_BUILD_SSL", "#define VSF_BUILD_SSL"
|
|
|
|
end
|
|
|
|
|
2010-09-09 05:56:24 +00:00
|
|
|
inreplace "defs.h", "/etc/vsftpd.conf", "#{etc}/vsftpd.conf"
|
|
|
|
inreplace "tunables.c", "/etc", etc
|
|
|
|
inreplace "tunables.c", "/var", var
|
|
|
|
system "make"
|
|
|
|
|
2010-10-07 03:14:58 +00:00
|
|
|
# make install has all the paths hardcoded; this is easier:
|
2010-09-09 05:56:24 +00:00
|
|
|
sbin.install "vsftpd"
|
|
|
|
man5.install "vsftpd.conf.5"
|
|
|
|
man8.install "vsftpd.8"
|
|
|
|
end
|
2011-11-06 22:59:08 +00:00
|
|
|
|
|
|
|
def caveats
|
2012-08-25 16:39:16 +00:00
|
|
|
if build.include? "openssl"
|
2011-11-06 22:59:08 +00:00
|
|
|
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
|
2010-09-09 05:56:24 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/sysdeputil.c b/sysdeputil.c
|
|
|
|
index 9dc8a5e..66dbe30 100644
|
|
|
|
--- a/sysdeputil.c
|
|
|
|
+++ b/sysdeputil.c
|
|
|
|
@@ -64,6 +64,10 @@
|
|
|
|
#include <utmpx.h>
|
|
|
|
|
|
|
|
/* BEGIN config */
|
|
|
|
+#if defined(__APPLE__)
|
|
|
|
+ #undef VSF_SYSDEP_HAVE_UTMPX
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#if defined(__linux__)
|
|
|
|
#include <errno.h>
|
|
|
|
#include <syscall.h>
|
|
|
|
diff --git a/vsf_findlibs.sh b/vsf_findlibs.sh
|
|
|
|
index b988be6..68d4a34 100755
|
|
|
|
--- a/vsf_findlibs.sh
|
|
|
|
+++ b/vsf_findlibs.sh
|
|
|
|
@@ -20,6 +20,8 @@ if find_func pam_start sysdeputil.o; then
|
|
|
|
locate_library /usr/lib/libpam.sl && echo "-lpam";
|
|
|
|
# AIX ends shared libraries with .a
|
|
|
|
locate_library /usr/lib/libpam.a && echo "-lpam";
|
|
|
|
+ # Mac OS X / Darwin shared libraries with .dylib
|
|
|
|
+ locate_library /usr/lib/libpam.dylib && echo "-lpam";
|
|
|
|
else
|
|
|
|
locate_library /lib/libcrypt.so && echo "-lcrypt";
|
|
|
|
locate_library /usr/lib/libcrypt.so && echo "-lcrypt";
|