homebrew-core/Formula/proftpd.rb
2019-11-23 20:32:47 -05:00

62 lines
2.1 KiB
Ruby

class Proftpd < Formula
desc "Highly configurable GPL-licensed FTP server software"
homepage "http://www.proftpd.org/"
url "ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.6b.tar.gz"
mirror "https://fossies.org/linux/misc/proftpd-1.3.6b.tar.gz"
mirror "https://ftp.osuosl.org/pub/blfs/conglomeration/proftpd/proftpd-1.3.6b.tar.gz"
sha256 "fe5baf6c469a2b0b7f0e2611561b6fd5414300e32a76b96adb2ccfe05b5efb60"
bottle do
sha256 "deb508061dfb34bf77c92a5435cdb42bbb8a9b3084098ba39dcbfc53f013b56b" => :catalina
sha256 "9abb9e0ec3f51055f7c2becadc0ba6bc911b886f32228a04c8564c51d36fc055" => :mojave
sha256 "82ddf96573296e08144d4418b7aa85dfd1540150fa6c5f732a928c4147099dba" => :high_sierra
end
def install
# fixes unknown group 'nogroup'
# http://www.proftpd.org/docs/faq/linked/faq-ch4.html#AEN434
inreplace "sample-configurations/basic.conf", "nogroup", "nobody"
system "./configure", "--prefix=#{prefix}",
"--sysconfdir=#{etc}",
"--localstatedir=#{var}"
ENV.deparallelize
install_user = ENV["USER"]
install_group = `groups`.split[0]
system "make", "INSTALL_USER=#{install_user}", "INSTALL_GROUP=#{install_group}", "install"
end
plist_options :manual => "proftpd"
def plist; <<~EOS
<?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>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>#{opt_sbin}/proftpd</string>
</array>
<key>UserName</key>
<string>root</string>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
</dict>
</plist>
EOS
end
test do
assert_match version.to_s, shell_output("#{opt_sbin}/proftpd -v")
end
end