2010-04-24 02:22:13 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class OfflineImap < Formula
|
2011-04-16 03:49:01 +00:00
|
|
|
url "https://github.com/nicolas33/offlineimap.git", :tag => 'v6.3.2.1'
|
|
|
|
version '6.3.2.1'
|
|
|
|
homepage "http://offlineimap.org/"
|
2010-04-24 02:22:13 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
libexec.install 'bin/offlineimap' => 'offlineimap.py'
|
|
|
|
libexec.install 'offlineimap'
|
2011-04-16 03:49:01 +00:00
|
|
|
prefix.install [ 'offlineimap.conf', 'offlineimap.conf.minimal' ]
|
2010-04-24 02:22:13 +00:00
|
|
|
bin.mkpath
|
|
|
|
ln_s libexec+'offlineimap.py', bin+'offlineimap'
|
2011-04-16 03:49:01 +00:00
|
|
|
(prefix+'org.offlineimap.plist').write startup_plist
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To get started, copy one of these configurations to ~/.offlineimaprc:
|
|
|
|
* minimal configuration:
|
|
|
|
cp -n #{prefix}/offlineimap.conf.minimal ~/.offlineimaprc
|
|
|
|
|
|
|
|
* advanced configuration:
|
|
|
|
cp -n #{prefix}/offlineimap.conf ~/.offlineimaprc
|
|
|
|
|
|
|
|
|
|
|
|
To launch on startup and run every 5 minutes:
|
|
|
|
* if this is your first install:
|
|
|
|
mkdir -p ~/Library/LaunchAgents
|
|
|
|
cp #{prefix}/org.offlineimap.plist ~/Library/LaunchAgents/
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/org.offlineimap.plist
|
|
|
|
|
|
|
|
* if this is an upgrade and you already have the org.offlineimap.plist loaded:
|
|
|
|
launchctl unload -w ~/Library/LaunchAgents/org.offlineimap.plist
|
|
|
|
cp #{prefix}/org.offlineimap.plist ~/Library/LaunchAgents/
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/org.offlineimap.plist
|
|
|
|
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def startup_plist; <<-EOPLIST.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>KeepAlive</key>
|
|
|
|
<false/>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>org.offlineimap</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>/usr/local/bin/offlineimap</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>
|
|
|
|
EOPLIST
|
2010-04-24 02:22:13 +00:00
|
|
|
end
|
|
|
|
end
|