homebrew-core/Formula/offlineimap.rb
2019-10-17 19:37:37 +02:00

92 lines
3.1 KiB
Ruby

class Offlineimap < Formula
desc "Synchronizes emails between two repositories"
homepage "https://www.offlineimap.org/"
url "https://github.com/OfflineIMAP/offlineimap/archive/v7.2.4.tar.gz"
sha256 "5b6590c82cd5f6cbfe09e89ce52622208f5d4b24e021fce7646204b417bd1d2e"
head "https://github.com/OfflineIMAP/offlineimap.git"
bottle do
cellar :any_skip_relocation
sha256 "a3ac6876694a5c6201a84bed06215418ecac6f57505caec64f99d99fafc79d65" => :catalina
sha256 "c9620b87d09719d7950203ec39e04b0ea4bb7a03cf169c3fa5596e0c53e7c177" => :mojave
sha256 "c9620b87d09719d7950203ec39e04b0ea4bb7a03cf169c3fa5596e0c53e7c177" => :high_sierra
sha256 "d56fbea8ca30549b4f5e3e5e294cae0dcf4363a08d7574d8b7e8abaa70f9ff17" => :sierra
end
depends_on "asciidoc" => :build
depends_on "docbook-xsl" => :build
depends_on "sphinx-doc" => :build
depends_on "python@2" # does not support Python 3
resource "six" do
url "https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz"
sha256 "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
end
def install
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
system "make", "docs"
man1.install "docs/offlineimap.1"
man7.install "docs/offlineimapui.7"
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
resource("six").stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
etc.install "offlineimap.conf", "offlineimap.conf.minimal"
libexec.install "bin/offlineimap" => "offlineimap.py"
libexec.install "offlineimap"
(bin/"offlineimap").write_env_script(libexec/"offlineimap.py",
:PYTHONPATH => ENV["PYTHONPATH"])
end
def caveats; <<~EOS
To get started, copy one of these configurations to ~/.offlineimaprc:
* minimal configuration:
cp -n #{etc}/offlineimap.conf.minimal ~/.offlineimaprc
* advanced configuration:
cp -n #{etc}/offlineimap.conf ~/.offlineimaprc
EOS
end
plist_options :manual => "offlineimap"
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>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin</string>
</dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/offlineimap</string>
<string>-q</string>
<string>-u</string>
<string>basic</string>
</array>
<key>StartInterval</key>
<integer>300</integer>
<key>RunAtLoad</key>
<true />
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
</dict>
</plist>
EOS
end
test do
system bin/"offlineimap", "--version"
end
end