Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Last active March 6, 2021 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtrouton/aae5bc0d0100b431c161bc7aa0d448b5 to your computer and use it in GitHub Desktop.
Save rtrouton/aae5bc0d0100b431c161bc7aa0d448b5 to your computer and use it in GitHub Desktop.
Postman .pkg recipe with PkgSigner processor
<?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 latest version of Postman and creates a signed installer package.</string>
<key>Identifier</key>
<string>net.trouton.pkg.postman</string>
<key>Input</key>
<dict>
<key>NAME</key>
<string>Postman</string>
<key>VENDOR</key>
<string>Postman</string>
<key>SOFTWARETITLE</key>
<string>Labs</string>
<key>SOFTWARETYPE</key>
<string>Postman</string>
<key>SIGNINGCERTIFICATE</key>
<string>Put_Signing_Certificate_into_AutoPkg_recipe_override</string>
</dict>
<key>MinimumVersion</key>
<string>1.0.0</string>
<key>ParentRecipe</key>
<string>com.github.dataJAR-recipes.download.postman</string>
<key>Process</key>
<array>
<dict>
<key>Arguments</key>
<dict>
<key>predicate</key>
<string>SIGNINGCERTIFICATE == "Put_Signing_Certificate_into_AutoPkg_recipe_override"</string>
</dict>
<key>Processor</key>
<string>StopProcessingIf</string>
</dict>
<dict>
<key>Processor</key>
<string>PkgRootCreator</string>
<key>Arguments</key>
<dict>
<key>pkgroot</key>
<string>%RECIPE_CACHE_DIR%/%SOFTWARETYPE%</string>
<key>pkgdirs</key>
<dict>
<key>Applications</key>
<string>0755</string>
</dict>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>Unarchiver</string>
<key>Arguments</key>
<dict>
<key>archive_path</key>
<string>%pathname%</string>
<key>destination_path</key>
<string>%pkgroot%/Applications</string>
<key>purge_destination</key>
<true />
</dict>
</dict>
<dict>
<key>Processor</key>
<string>Versioner</string>
<key>Arguments</key>
<dict>
<key>input_plist_path</key>
<string>%pkgroot%/Applications/%SOFTWARETYPE%.app/Contents/Info.plist</string>
<key>plist_version_key</key>
<string>CFBundleShortVersionString</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PkgCreator</string>
<key>Arguments</key>
<dict>
<key>pkgname</key>
<string>%VENDOR%_%SOFTWARETITLE%_%SOFTWARETYPE%_%version%</string>
<key>pkg_request</key>
<dict>
<key>version</key>
<string>%version%</string>
<key>id</key>
<string>com.postmanlabs.mac</string>
<key>options</key>
<string>purge_ds_store</string>
<key>chown</key>
<array>
<dict>
<key>path</key>
<string>Applications</string>
<key>user</key>
<string>root</string>
<key>group</key>
<string>wheel</string>
</dict>
</array>
</dict>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PkgSigner</string>
<key>Arguments</key>
<dict>
<key>pkg_path</key>
<string>%RECIPE_CACHE_DIR%/%VENDOR%_%SOFTWARETITLE%_%SOFTWARETYPE%_%version%.pkg</string>
<key>signing_cert</key>
<string>%SIGNINGCERTIFICATE%</string>
</dict>
</dict>
<dict>
<key>Arguments</key>
<dict>
<key>path_list</key>
<array>
<string>%RECIPE_CACHE_DIR%/%SOFTWARETYPE%</string>
</array>
</dict>
<key>Processor</key>
<string>PathDeleter</string>
</dict>
</array>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment