2010-04-24 02:22:13 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class OfflineImap < Formula
|
2012-02-10 01:11:28 +00:00
|
|
|
homepage 'http://offlineimap.org/'
|
|
|
|
url 'https://github.com/downloads/spaetz/offlineimap/offlineimap-v6.5.2.1.tar.gz'
|
|
|
|
md5 'fd87752605eb8d98d7addc70a8e96576'
|
|
|
|
|
|
|
|
head 'https://github.com/spaetz/offlineimap.git'
|
2010-04-24 02:22:13 +00:00
|
|
|
|
|
|
|
def install
|
2012-02-13 01:29:05 +00:00
|
|
|
prefix.install 'offlineimap.conf', 'offlineimap.conf.minimal'
|
2010-04-24 02:22:13 +00:00
|
|
|
libexec.install 'bin/offlineimap' => 'offlineimap.py'
|
|
|
|
libexec.install 'offlineimap'
|
2012-02-13 01:29:05 +00:00
|
|
|
bin.install_symlink libexec+'offlineimap.py' => 'offlineimap'
|
|
|
|
|
2011-12-31 05:56:52 +00:00
|
|
|
plist_path.write startup_plist
|
|
|
|
plist_path.chmod 0644
|
2011-04-16 03:49:01 +00:00
|
|
|
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
|
2011-12-31 05:56:52 +00:00
|
|
|
cp #{plist_path} ~/Library/LaunchAgents/
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
|
2011-04-16 03:49:01 +00:00
|
|
|
|
2012-02-04 14:57:53 +00:00
|
|
|
* if this is an upgrade and you already have the #{plist_path.basename} loaded:
|
2011-12-31 05:56:52 +00:00
|
|
|
launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename}
|
|
|
|
cp #{plist_path} ~/Library/LaunchAgents/
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
|
2011-04-16 03:49:01 +00:00
|
|
|
|
|
|
|
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>
|
2011-12-31 05:56:52 +00:00
|
|
|
<string>#{plist_name}</string>
|
2011-04-16 03:49:01 +00:00
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
2011-12-31 22:13:31 +00:00
|
|
|
<string>#{HOMEBREW_PREFIX}/bin/offlineimap</string>
|
2011-04-16 03:49:01 +00:00
|
|
|
</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
|