Skip to content

Instantly share code, notes, and snippets.

@arubdesu
Created December 17, 2014 16:24
Show Gist options
  • Save arubdesu/1d97035a890fcca64b44 to your computer and use it in GitHub Desktop.
Save arubdesu/1d97035a890fcca64b44 to your computer and use it in GitHub Desktop.
Autopkg recipe to download the most recent Sonos controller
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>Downloads the current release version of Sonos.</string>
<key>Identifier</key>
<string>com.github.autopkg.download.Sonos</string>
<key>Input</key>
<dict>
<key>NAME</key>
<string>Sonos</string>
<key>USER_AGENT</key>
<string>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.28.10 (KHTML, like Gecko) Version/6.0.3 Safari/536.28.10</string>
</dict>
<key>Process</key>
<array>
<dict>
<key>Processor</key>
<string>URLTextSearcher</string>
<key>Arguments</key>
<dict>
<key>url</key>
<string>http://www.sonos.com/support</string>
<key>re_pattern</key>
<string>(?P&lt;url&gt;http.*?controller_software_mac)</string>
<key>request_headers</key>
<dict>
<key>user-agent</key>
<string>%USER_AGENT%</string>
</dict>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>URLDownloader</string>
</dict>
<dict>
<key>Processor</key>
<string>EndOfCheckPhase</string>
</dict>
<dict>
<key>Processor</key>
<string>AppDmgVersioner</string>
<key>Arguments</key>
<dict>
<key>dmg_path</key>
<string>%pathname%</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>Copier</string>
<key>Arguments</key>
<dict>
<key>source_path</key>
<string>%pathname%</string>
<key>destination_path</key>
<string>%RECIPE_CACHE_DIR%/%NAME%.app</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>CodeSignatureVerifier</string>
<key>Arguments</key>
<dict>
<key>input_path</key>
<string>%RECIPE_CACHE_DIR%/%NAME%.app</string>
<key>requirement</key>
<string>identifier "com.sonos.macController" and anchor apple generic</string>
</dict>
</dict>
</array>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment