97 lines
2.6 KiB
Ruby
97 lines
2.6 KiB
Ruby
class Dovecot < Formula
|
|
desc "IMAP/POP3 server"
|
|
homepage "https://dovecot.org/"
|
|
url "https://dovecot.org/releases/2.3/dovecot-2.3.2.1.tar.gz"
|
|
sha256 "4a65118508dc7a562e5f90dd7c3f56219fff22367c496f17d77cd0c7e2724e34"
|
|
revision 1
|
|
|
|
bottle do
|
|
sha256 "6626329909388aafbb99245c8fcd458333f72318cca0b40f32dd4901243fa633" => :mojave
|
|
sha256 "9cebefeee05f78fa705d1b1955027c4d60095d70b572658d4fd98d3b68912d01" => :high_sierra
|
|
sha256 "f7cd5b3ffb07fffc80c3f7af828efbe745ea72978112721558a19910b6c09e4c" => :sierra
|
|
end
|
|
|
|
depends_on "openssl"
|
|
|
|
resource "pigeonhole" do
|
|
url "https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3-pigeonhole-0.5.2.tar.gz"
|
|
sha256 "950e8e15c58e539761255e140dd3678dd2477fa432a5f2b804e53821bdc02535"
|
|
end
|
|
|
|
def install
|
|
args = %W[
|
|
--prefix=#{prefix}
|
|
--disable-dependency-tracking
|
|
--libexecdir=#{libexec}
|
|
--sysconfdir=#{etc}
|
|
--localstatedir=#{var}
|
|
--with-bzlib
|
|
--with-pam
|
|
--with-sqlite
|
|
--with-ssl=openssl
|
|
--with-zlib
|
|
]
|
|
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
|
|
resource("pigeonhole").stage do
|
|
args = %W[
|
|
--disable-dependency-tracking
|
|
--with-dovecot=#{lib}/dovecot
|
|
--prefix=#{prefix}
|
|
]
|
|
|
|
system "./configure", *args
|
|
system "make"
|
|
system "make", "install"
|
|
end
|
|
end
|
|
|
|
def caveats; <<~EOS
|
|
For Dovecot to work, you may need to create a dovecot user
|
|
and group depending on your configuration file options.
|
|
EOS
|
|
end
|
|
|
|
plist_options :startup => true
|
|
|
|
def plist; <<~EOS
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>KeepAlive</key>
|
|
<false/>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_sbin}/dovecot</string>
|
|
<string>-F</string>
|
|
</array>
|
|
<key>StandardErrorPath</key>
|
|
<string>#{var}/log/dovecot/dovecot.log</string>
|
|
<key>StandardOutPath</key>
|
|
<string>#{var}/log/dovecot/dovecot.log</string>
|
|
<key>SoftResourceLimits</key>
|
|
<dict>
|
|
<key>NumberOfFiles</key>
|
|
<integer>1000</integer>
|
|
</dict>
|
|
<key>HardResourceLimits</key>
|
|
<dict>
|
|
<key>NumberOfFiles</key>
|
|
<integer>1024</integer>
|
|
</dict>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
assert_match version.to_s, shell_output("#{sbin}/dovecot --version")
|
|
end
|
|
end
|