AFP548 Site News August 1, 2014 at 11:55 am

Create 100’s of Autopkg Recipes With This One Weird Trick

If you’re like me, you love autopkg. You don’t even want to perform web searches for download links anymore.
I’m told there are certain things that can’t be automated. But, when I first saw that many recipes could follow roughly the same format, I thought to myself ‘we have to go deeper'(BUMMMMMMM!BUMBUM!)
I created RecipeGenerationUtils, which lazily generates plists in an easily-customizable format. This allows you to follow a suggested pipeline of making download, then munki, then pkg recipes for apps that leverage the Sparkle framework of checking an RSS feed to discover updates. Each recipe step builds upon the previous, and one can obviously extend it for Absolute Manage, DeployStudio, FileWave, or Casper recipes just the same. I threw in a convenience script to find .app bundles and the associated appcast URL/bundle identifier in your ~/Downloads, /Applications and /Apps/Utilities folders, which put many of the pieces in your hands.

Then Tim Sutton came along and showed the world this:

A project that is a branching-off of the Homebrew command line tool installer, called Cask, has gained a lot of attention recently as it allows you to install many popular GUI apps from the command line as well. I’ve found its ability to update apps lacking, but it does have a groundswell of community participation, so one smart system can help the other! I set to work applying my generation utils on the hundreds of appcast feeds mentioned in Tim’s tweet above, and soon after had nearly 400 ‘live'(read=working at time of writing) download recipes to inagurate the Experimental-Brew-Cask-Recipes repo. After confirming the ids of the zipped apps I was able to fetch, pkg recipes were generated, and munki recipes for many others. The description for the apps in the generated munkirecipes are blank, and all of these should get a good look-see, once-over check that they are functional and won’t harsh your mellow.
As a result of all this heavy lifting, you can add these ‘seedlings’ of recipes to grow in your own repo, after checking my user for a starting point, which you can search for by running e.g. autopkg search -u arubdesu xscope or for other apps, which returns output like this:

autopkg search -u arubdesu sketch

Name                   Repo/path
----                   --------- arubdesu/Experimental-Brew-Cask-Recipes/sketch/
sketch.munki.recipe    arubdesu/Experimental-Brew-Cask-Recipes/sketch/sketch.munki.recipe
sketch.pkg.recipe      arubdesu/Experimental-Brew-Cask-Recipes/sketch/sketch.pkg.recipe

One other note for folks hoping to utilize these ‘experimental’ recipes: you should probably change the ‘Identifier’ to the reverse domain of either a URL/domain registered to you, or if you host the repo on Github, it’s kindof convention to use com.github.yourusername.pkg.recipe. Also keep in mind, as many recipes build upon another, make sure the Parent Recipe identifier matches what you’ve changed the Identifier to upstream. Hope this saves folks time in the future as we AUTOPKG ALL THE THINGS!

Allister Banks

Allister lives in Japan, has not read the Slack scroll back, and therefore has no idea what is going on.

More Posts - Website

Follow Me:

Leave a reply

You must be logged in to post a comment.