homebrew-core/Formula/pure-ftpd.rb

65 lines
1.8 KiB
Ruby
Raw Normal View History

require 'formula'
class PureFtpd < Formula
homepage 'http://www.pureftpd.org/'
2012-09-08 19:19:08 +00:00
url 'http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.35.tar.gz'
sha1 'fed26bb1f36d71819a08873d94bbda52522ff96a'
def install
args = ["--disable-dependency-tracking",
2012-03-03 23:50:27 +00:00
"--prefix=#{prefix}",
"--mandir=#{man}",
"--sysconfdir=#{etc}",
"--with-pam",
"--with-altlog",
"--with-puredb",
"--with-throttling",
"--with-ratios",
"--with-quotas",
"--with-ftpwho",
"--with-virtualhosts",
"--with-virtualchroot",
"--with-diraliases",
"--with-peruserlimits",
"--with-tls",
"--with-bonjour"]
2012-03-03 23:50:27 +00:00
args << "--with-pgsql" if which 'pg_config'
args << "--with-mysql" if which 'mysql'
system "./configure", *args
system "make install"
end
plist_options :manual => 'pure-ftpd'
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_prefix}/sbin/pure-ftpd</string>
<string>-A -j -z</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>#{`whoami`.chomp}</string>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/pure-ftpd.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/pure-ftpd.log</string>
</dict>
</plist>
EOS
end
end