homebysix / recipe-robot

A kick ass tool for creating AutoPkg recipes.
Apache License 2.0
300 stars 28 forks source link

Support Payload that is just an App bundle #195

Closed andrewzirkel closed 1 year ago

andrewzirkel commented 1 year ago

This addition supports payloads that just contain the contents of an app bundle. I'm not sure how common this is but I've come across it.

Consider the Smart Mirror App https://downloads.smarttech.com/software/smartmirror/mac/SMART_Mirror_App.pkg from https://www.smartmirror.link/ referenced in https://github.com/autopkg/andrewzirkel-recipes/tree/master/SMARTMirrorApp created by recipe-robot with the attached changes.

Thank you!

homebysix commented 1 year ago

Testing results:

% ./scripts/recipe-robot --verbose --ignore-existing "https://downloads.smarttech.com/software/smartmirror/mac/SMART_Mirror_App.pkg"
[WARNING] Will build recipes even if they already exist in "autopkg search" results. Please don't upload duplicate recipes to public AutoPkg repos on GitHub.

                      -----------------------------------
                     |  Welcome to Recipe Robot v2.3.0.  |
                      -----------------------------------
                                \   _[]_
                                 \  [oo]
                                   d-||-b
                                     ||
                                   _/  \_

Processing: https://downloads.smarttech.com/software/smartmirror/mac/SMART_Mirror_App.pkg
Input path looks like a download URL.
    Download URL is: https://downloads.smarttech.com/software/smartmirror/mac/SMART_Mirror_App.pkg
Downloading file for further inspection...
    Download content-type is binary/octet-stream
############################################################################################################################################################################################################## 100.0%
    Downloaded to ~/Library/Caches/Recipe Robot/2022-11-24_11-12-21_072122/SMART_Mirror_App.pkg
Determining download format...
    File extension is pkg
Checking whether package is signed...
    Package is signed
Getting developer from pkg signature...
    Developer is: SMART Technologies ULC
Getting package signature authority names...
    3 authority names recorded
Expanding package to look for clues...
    Package expanded to: ~/Library/Caches/Recipe Robot/2022-11-24_11-12-21_072122/expanded
Payload is an App, move to .app
Trying to get bundle identifier from PackageInfo file...
    Bundle identifier (tentative): com.smarttech.smartmirrorapp
    Added blocking application: SMART Mirror App.app
    Added blocking application: QtWebEngineProcess.app
[WARNING] Multiple apps found in payload. I'll do my best to figure out which one to use.
    Using app: SMART Mirror App.app
    In container package: SMARTMirrorApp.pkg
Validating app...
    This app seems valid
Getting bundle name...
    Bundle name is: SMARTMirrorApp
Bundle name differs from the actual app filename.
    Actual app filename: SMART Mirror App.app
Getting bundle identifier...
    Bundle identifier is: com.smarttech.smartmirrorapp
Checking for a Sparkle feed...
    No Sparkle feed
Looking for version key...
    Version key is: CFBundleShortVersionString (2.12.0.15174)
Looking for icon...
    Icon is: ~/Library/Caches/Recipe Robot/2022-11-24_11-12-21_072122/payload0/SMART Mirror App.app/Contents/Resources/app-macos.icns
Getting description...
    Can't retrieve description.
Generating download recipe...
    ~/Library/AutoPkg/Recipe Robot Output/SMART Technologies ULC/SMARTMirrorApp.download.recipe
Generating pkg recipe...
[WARNING] Skipping pkg recipe, since the download format is already pkg.
Generating munki recipe...
[REMINDER] I couldn't find a description for this app, so you'll need to manually add one to the munki recipe.
    ~/Library/AutoPkg/Recipe Robot Output/SMART Technologies ULC/SMARTMirrorApp.png
    ~/Library/AutoPkg/Recipe Robot Output/SMART Technologies ULC/SMARTMirrorApp.munki.recipe
Generating install recipe...
    ~/Library/AutoPkg/Recipe Robot Output/SMART Technologies ULC/SMARTMirrorApp.install.recipe

You've created 5212 recipes with Recipe Robot. Terrific job!

Thanks!