homebrew-core/Formula/proftpd.rb

76 lines
2.6 KiB
Ruby

class Proftpd < Formula
desc "Highly configurable GPL-licensed FTP server software"
homepage "http://www.proftpd.org/"
url "https://github.com/proftpd/proftpd/archive/v1.3.7a.tar.gz"
mirror "https://fossies.org/linux/misc/proftpd-1.3.7a.tar.gz"
mirror "https://ftp.osuosl.org/pub/blfs/conglomeration/proftpd/proftpd-1.3.7a.tar.gz"
sha256 "8b7bbf9757988935352d9dec5ebf96b6a1e6b63a6cdac2e93202ac6c42c4cd96"
license "GPL-2.0"
# Proftpd uses an incrementing letter after the numeric version for
# maintenance releases. Versions like `1.2.3a` and `1.2.3b` are not alpha and
# beta respectively. Prerelease versions use a format like `1.2.3rc1`.
livecheck do
url :stable
strategy :github_latest
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+[a-z]?)["' >]}i)
end
bottle do
rebuild 1
sha256 arm64_big_sur: "69ababb50c7eeb1f86521b9835620354a88b7f68b2eaeaf0f89a9ca86893c052"
sha256 big_sur: "2f410eb0a7911309e27bdf9a9af1528561f9f5f32f80967b6727a100020bd6bc"
sha256 catalina: "18815adf6ee8958854a6962afb377e00642eafde5b8ac1d89cd69f211914343b"
sha256 mojave: "d24f1a6000fb47caf68ef104770b1ed66d284439a5d8cf9c9b5688fae073b47d"
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