homebrew-core/Formula/dovecot.rb
Mike McQuaid 7a4dabfc1a Use hash rockets again. (#5177)
This restores 1.8 hash rockets because they look nicer with e.g. `depends_on :foo => :bar`
2016-09-24 16:45:48 +01:00

113 lines
3.3 KiB
Ruby

class Dovecot < Formula
desc "IMAP/POP3 server"
homepage "http://dovecot.org/"
url "http://dovecot.org/releases/2.2/dovecot-2.2.25.tar.gz"
mirror "https://fossies.org/linux/misc/dovecot-2.2.25.tar.gz"
sha256 "d8d9f32c846397f7c22749a84c5cf6f59c55ff7ded3dc9f07749a255182f9667"
bottle do
sha256 "0edf46eeaeb7fa6b7b0e20c57754a007a17ca62826398770f684a69224dc0be2" => :el_capitan
sha256 "32d3eb3fdd200372572aadfd32a3f451ed86ae0eae1fab51e7037ef3388dab0d" => :yosemite
sha256 "34ca4bf636bec3fcf5109da84193cb8496300d9c85edac2595da62d118d8618f" => :mavericks
end
option "with-pam", "Build with PAM support"
option "with-pigeonhole", "Add Sieve addon for Dovecot mailserver"
option "with-pigeonhole-unfinished-features", "Build unfinished new Sieve addon features/extensions"
option "with-stemmer", "Build with libstemmer support"
depends_on "openssl"
depends_on "clucene" => :optional
resource "pigeonhole" do
url "http://pigeonhole.dovecot.org/releases/2.2/dovecot-2.2-pigeonhole-0.4.15.tar.gz"
sha256 "c99ace6ead310c6c3b639922da618f90d846307da4fe252d994e5e51bf8a3de3"
end
resource "stemmer" do
url "https://github.com/snowballstem/snowball.git",
:revision => "3b1f4c2ac4b924bb429f929d9decd3f50662a6e0"
end
def install
args = %W[
--prefix=#{prefix}
--disable-dependency-tracking
--libexecdir=#{libexec}
--sysconfdir=#{etc}
--localstatedir=#{var}
--with-ssl=openssl
--with-sqlite
--with-zlib
--with-bzlib
]
args << "--with-lucene" if build.with? "clucene"
args << "--with-pam" if build.with? "pam"
if build.with? "stemmer"
args << "--with-libstemmer"
resource("stemmer").stage do
system "make", "dist_libstemmer_c"
system "tar", "xzf", "dist/libstemmer_c.tgz", "-C", buildpath
end
end
system "./configure", *args
system "make", "install"
if build.with? "pigeonhole"
resource("pigeonhole").stage do
args = %W[
--disable-dependency-tracking
--with-dovecot=#{lib}/dovecot
--prefix=#{prefix}
]
args << "--with-unfinished-features" if build.with? "pigeonhole-unfinished-features"
system "./configure", *args
system "make"
system "make", "install"
end
end
end
def caveats; <<-EOS.undent
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.undent
<?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>
</dict>
</plist>
EOS
end
test do
assert_match /#{version}/, shell_output("#{sbin}/dovecot --version")
end
end