homebrew-core/Formula/offlineimap.rb

86 lines
3.5 KiB
Ruby

class Offlineimap < Formula
include Language::Python::Virtualenv
desc "Synchronizes emails between two repositories"
homepage "https://www.offlineimap.org/"
url "https://github.com/OfflineIMAP/offlineimap3/archive/v8.0.0.tar.gz"
sha256 "5d40c163ca2fbf89658116e29f8fa75050d0c34c29619019eee1a84c90fcab32"
license "GPL-2.0-or-later"
head "https://github.com/OfflineIMAP/offlineimap3.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "ca6ca7b5637188d594991786dd26549070571cde325550c4ec301fd0b50d9d3b"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "7f1fb2cdac203f0fd3d933f0448b0d33eddd68088302f5ae3b0c2feb50ae2597"
sha256 cellar: :any_skip_relocation, monterey: "37cb69a7d2cb44b30f248c823dd60861a24e9c12275c064903fe4d36a2791994"
sha256 cellar: :any_skip_relocation, big_sur: "c9df9bac321c169322310691fc2e9727221d1f8692cd21bed9588f05521b8d35"
sha256 cellar: :any_skip_relocation, catalina: "42b1a6148dfed890446dc73e0cdc63214089b1eb0f1623b24ac298f043998fc8"
end
depends_on "python@3.9"
resource "certifi" do
url "https://files.pythonhosted.org/packages/6c/ae/d26450834f0acc9e3d1f74508da6df1551ceab6c2ce0766a593362d6d57f/certifi-2021.10.8.tar.gz"
sha256 "78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"
end
resource "decorator" do
url "https://files.pythonhosted.org/packages/92/3c/34f8448b61809968052882b830f7d8d9a8e1c07048f70deb039ae599f73c/decorator-5.1.0.tar.gz"
sha256 "e59913af105b9860aa2c8d3272d9de5a56a4e608db9a2f167a8480b323d529a7"
end
resource "distro" do
url "https://files.pythonhosted.org/packages/a5/26/256fa167fe1bf8b97130b4609464be20331af8a3af190fb636a8a7efd7a2/distro-1.6.0.tar.gz"
sha256 "83f5e5a09f9c5f68f60173de572930effbcc0287bb84fdc4426cb4168c088424"
end
resource "gssapi" do
url "https://files.pythonhosted.org/packages/e4/4d/03fcc6a2d052920336069df97866d7b506556ed9f3a5ee2ca1e0cbad45d4/gssapi-1.7.2.tar.gz"
sha256 "748efbcf7cfb31183cd75e5314493e79fe3521b3ec00d090a77e23f7c75fa59d"
end
resource "imaplib2" do
url "https://files.pythonhosted.org/packages/e4/1a/4ccb857f4832d2836a8c996f18fa7bcad19bfdf1a375dfa12e29dbe0e44a/imaplib2-3.6.tar.gz"
sha256 "96cb485b31868a242cb98d5c5dc67b39b22a6359f30316de536060488e581e5b"
end
resource "portalocker" do
url "https://files.pythonhosted.org/packages/38/2e/32172e8418f2ba284cee4fd67cb547d39a7debb3eed37d514da173786112/portalocker-2.3.2.tar.gz"
sha256 "75cfe02f702737f1726d83e04eedfa0bda2cc5b974b1ceafb8d6b42377efbd5f"
end
resource "rfc6555" do
url "https://files.pythonhosted.org/packages/f6/4b/24f953c3682c134e4d0f83c7be5ede44c6c653f7d2c0b06ebb3b117f005a/rfc6555-0.1.0.tar.gz"
sha256 "123905b8f68e2bec0c15f321998a262b27e2eaadea29a28bd270021ada411b67"
end
def install
virtualenv_install_with_resources
etc.install "offlineimap.conf", "offlineimap.conf.minimal"
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
service do
run [opt_bin/"offlineimap", "-q", "-u", "basic"]
run_type :interval
interval 300
environment_variables PATH: std_service_path_env
log_path "/dev/null"
error_log_path "/dev/null"
end
test do
system bin/"offlineimap", "--version"
end
end