Orchard's autopkg configuration is hosted on a Mac Pro with a large local storage array.
The buildhost has has a local user 'autopkg' whose $HOME is in /srv/autopkg/. Because autopkg does not work well in multi-user environments (each user would need the same set of recipe repos imported and cannot share preferences), the autopkg user has all the defaults set necessary to build our software set, and it is necessary to switch to this user by prefixing $ sudo -u autopkg to issue any autopkg commands.
All recipes should be overridden locally, even if you have written a recipe yourself. Recipes should be written for the wider autopkg community and any local standards/customisations should be done in an override.
The directory /srv/autopkg/RecipeOverrides/ is a git clone of the ox-it orchard-recipe-overrides repo on Github N.B. this repository is currently private, although we hope to make it public once certain sensitive information has been removed.
Once you have written a recipe, or imported a recipe repo containing a munki recipe you would like to use, you should issue
$ sudo -u autopkg autopkg make-override <RecipeName>.munki
This will create a recipe at /srv/autopkg/RecipeOverrides/<RecipeName>.munki.recipe which you must then edit.
The following standards should be observed:
<key>Identifier</key> should begin with uk.ac.ox.orchard. and not local.
<key>NAME</key> should be the name of the app with spaces expressed as underscores.
<key>MUNKI_REPO_SUBDIR</key> should be set to <string>%NAME%</string> (except when grouping logical collections of apps e.g. Adobe Creative Cloud or MS Office installer and its updates in which case it should be <string>Name_Of_Collection</string>
<key>MUNKI_CATEGORY</key> - if it exists - should have its string value set to one of the categories listed [[#|here]
For the <key>pkginfo</key> dict that autopkg passes to munki:
Change the string value of the <key>category</key> to unstable. New applications should always go into the unstable Munki catalog at first. After they have been running for a while, this can be changed to stage directly to testing.
... <key>category</key> <string>Design and Media</string> ...
If it's missing, add a <key>description</key> and a string value describing the app (this will appear to users in the Orchard Software Centre)
If <key>display_name</key> is set to <string>%NAME%</string> and you changed the value of <key>NAME</key> above, you will doubtless want to change this to a more readable display name for users.
Scripts to be run by munki when installing/removing this app should be added to the pkginfo dict. Create a <key>preinstall_script</key> or <key>postinstall_script</key> and add the HTML escaped script inside the corresponding <string></string> tags.
The command $ sed 's/&(?!amp;)/\&/g; s/</\</g; s/>/\>/g;' <filename> is very useful for escaping scripts on the command line.
To test your override issue $ sudo -u autopkg run -vv <RecipeName>.munki. You should see your app downloaded, optionally packaged, and then imported into Munki with a useful version number, along with the input and output of each processor step. If anything goes wrong with this process you will probably want to delete the package and associated pkginfo from the munki repo before making changes and trying again.
When you are satisfied with your edits, add the file to the next commit by issuing $ git add <filename> and then commit it to the repository with $ git commit -m "Commit message". Once you have finished creating or editing recipes you should then push them upstream with $ git push origin master which will prompt you for your github username and password.