Skip to content
Shea Craig edited this page Oct 23, 2015 · 7 revisions

Tool for making pkginfo files

Introduction

Well-crafted pkginfo files are the key to munki's functionality. Creating these by hand is tedious and error-prone. The makepkginfo tool can help.

Details

Tool: makepkginfo

Creates a managed install pkginfo plist given an Installer item: a .pkg, a .mpkg, a .mobileconfig profile, or a .dmg containing a .pkg or .mpkg at the root of the mounted disk image.

makepkginfo now also supports a few other dmg types:

  1. Drag-and-drop application dmgs
  2. Adobe CS4 Update installer dmgs
  3. DMGs containing Adobe CS4 Deployment Toolkit packages and install files
  4. (Adobe CS5/CS6/CC products are also supported, but generally must be repackaged with AAMEE or CCP. See Munki And Adobe CS5, Munki And Adobe CS6 and other wiki documentation for more info.)

You may also pass items that are installed by the package using the '-f' flag. These are added to the 'installs' key of the catalog item plist and are used when processing the catalog to check if the package needs to be installed or reinstalled.

You can leave off the installer item, and just pass "-f" items to build a list of items to add to an existing pkginfo file.

The generated plist is printed to STDOUT.

Usage: makepkginfo [/path/to/package_or_dmg] [-f /path/to/item/it/installs ...]

A simple example:

> ./makepkginfo /path/to/ServerAdminToold1055.dmg
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>description</key>
    <string></string>
    <key>installer_item_location</key>
    <string>ServerAdminToold1055.dmg</string>
    <key>minimum_os_version</key>
    <string>10.4.0</string>
    <key>name</key>
    <string>ServerAdministrationSoftware</string>
    <key>receipts</key>
    <array>
    	<dict>
    	    <key>packageid</key>
    	    <string>com.apple.pkg.ServerAdminTools</string>
    	    <key>version</key>
    	    <string>10.5.3.0</string>
    	</dict>
    	<dict>
    	    <key>packageid</key>
    	    <string>com.apple.pkg.ServerSetup</string>
    	    <key>version</key>
    	    <string>10.5.3.0</string>
        </dict>
    </array>
    <key>version</key>
    <string>10.5.3.0</string>
</dict>
</plist>

Another example:

> makepkginfo --file /Applications/iWork\ \'08/Keynote.app --file /Applications/iWork\ \'08/Pages.app --file /Applications/iWork\ \'08/Numbers.app /Volumes/iWork08/iWork08.pkg
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>description</key>
    <string></string>
    <key>installer_item_location</key>
    <string>iWork08.pkg</string>
    <key>installs</key>
    <array>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.apple.iWork.Keynote</string>
            <key>CFBundleName</key>
            <string>Keynote</string>
            <key>CFBundleShortVersionString</key>
            <string>4.0.3</string>
            <key>type</key>
            <string>application</string>
        </dict>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.apple.iWork.Pages</string>
            <key>CFBundleName</key>
            <string>Pages</string>
            <key>CFBundleShortVersionString</key>
            <string>3.0.2</string>
            <key>type</key>
            <string>application</string>
        </dict>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.apple.iWork.Numbers</string>
            <key>CFBundleShortVersionString</key>
            <string>1.0.2</string>
            <key>type</key>
            <string>application</string>
        </dict>
    </array>
    <key>minimum_os_version</key>
    <string>10.4.0</string>
    <key>name</key>
    <string>iWork</string>
    <key>receipts</key>
    <array>
        <dict>
            <key>packageid</key>
            <string>com.apple.pkg.iWork08</string>
            <key>version</key>
            <string>3.0.0.1352</string>
        </dict>
    </array>
    <key>version</key>
    <string>08</string>
</dict>
</plist>

Note that in both of these examples the required key installer_item_location will almost certainly be wrong unless you store all of your installer items at the root of the pkgs directory in the repo.

Here's makepkginfo run against a Firefox dmg:

> makepkginfo /Volumes/repo/pkgs/apps/Firefox\ 3.5.3.dmg
<?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>catalogs</key>
    <array>
        <string>testing</string>
    </array>
    <key>installer_item_location</key>
    <string>apps/Firefox 3.5.3.dmg</string>
    <key>installer_item_size</key>
    <integer>18002</integer>
    <key>installer_type</key>
    <string>appdmg</string>
    <key>installs</key>
    <array>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>org.mozilla.firefox</string>
            <key>CFBundleName</key>
            <string>Firefox</string>
            <key>CFBundleShortVersionString</key>
            <string>3.5.3</string>
            <key>path</key>
            <string>/Applications/Firefox.app</string>
            <key>type</key>
            <string>application</string>
        </dict>
    </array>
    <key>minimum_os_version</key>
    <string>10.4.0</string>
    <key>name</key>
    <string>Firefox</string>
    <key>uninstall_method</key>
    <string>remove_app</string>
    <key>uninstallable</key>
    <true/>
    <key>version</key>
    <string>3.5.3.0.0</string>
</dict>
</plist>

Options

makepkginfo supports a lot of options:

-h --help Show a help message and exit
-f FILE --file=FILE Path to a filesystem item installed by this package, typically an application. This generates an "installs" item for the pkginfo, an item munki can use to determine if this software has been installed. Can be specified multiple times.
-p PKGNAME --pkgname=PKGNAME Optional flag.
-If the installer item is a disk image containing multiple packages, or the package to be installed is not at the root of the mounted disk image, PKGNAME is a relative path from the root of the mounted disk image to the specific package to be installed.
-If the installer item is a disk image containing an Adobe CS4 Deployment Toolkit installation, PKGNAME is the name of an Adobe CS4 Deployment Toolkit installer package folder at the top level of the mounted dmg. If this flag is missing, the AdobeUber`*` files should be at the top level of the mounted dmg.
-i ITEM
-a ITEM
--itemname=ITEM
--appname=ITEM
Optional flag.
-If the installer item is a disk image with a drag-and-drop item, ITEMNAME is the name or relative path of the item to be installed.
Useful if there is more than one item at the root of the dmg.
--displayname=DISPLAYNAME Optional flag.
String display name of the package.
Note: overrides any display_name in the package itself.
--description=DESCRIPTION Optional flag.
String description of the package.
Note: overrides any description in the package itself
-d DESTINATIONPATH --destinationpath=DESTINATIONPATH Optional flag.
If the installer item is a disk image with a drag-and-drop item, this is the path to which the item should be copied. Defaults to "/Applications".
-u UNINSTALLERDMG --uninstallerdmg=UNINSTALLERDMG Optional flag.
If the installer item is a disk image containing an Adobe CS4 Deployment Toolkit installation package or Adobe CS3 deployment package, UNINSTALLERDMG is a path to a disk image containing an AdobeUberUninstaller for this item.
--postinstall_script=SCRIPT_PATH Optional flag.
Path to an optional postinstall script to be run after installation of the item. The script will be read and embedded into the pkginfo.
--preinstall_script=SCRIPT_PATH Optional flag.
Path to an optional preinstall script to be run before installation of the item. The script will be read and embedded into the pkginfo.
--postuninstall_script=SCRIPT_PATH Optional flag.
Path to an optional postuninstall script to be run after removal of the item. The script will be read and embedded into the pkginfo.
--preuninstall_script=SCRIPT_PATH Optional flag.
Path to an optional preuninstall script to be run before removal of the item. The script will be read and embedded into the pkginfo.
--uninstall_script=SCRIPT_PATH Optional flag.
Path to an uninstall script to be run in order to uninstall this item. The script will be read and embedded into the pkginfo.
-c CATALOG --catalog=CATALOG Optional flag.
Specifies in which catalog the item should appear. The default is 'testing'. Can be specified multiple times to add the item to multiple catalogs.
-o USER --owner=USER Optional flag.
If the installer item is a disk image used with the copy_from_dmg installer type, this sets the owner of the item specified by the --item flag. The owner may be either a UID or a symbolic name. The owner will be set recursively on the item.
-g GROUP --group=GROUP Optional flag.
If the installer item is a disk image used with the copy_from_dmg installer type, this sets the group of the item specified by the --item flag. The group may be either a GID or a symbolic name. The group will be set recursively on the item.
-m MODE --mode=MODE Optional flag.
If the installer item is a disk used with the copy_from_dmg installer type, this sets the mode of the item specified by the --item flag. The specified mode must be in symbolic form. See the manpage for chmod(1) for more information. The mode is applied recursively.
-V --version Print the version of the munki tools and exit.

Introduction

Munki 6.1

Munki 6

Munki 5

Managed Software Center

Command-line Tools

Munki configuration

Manifests

Catalogs

Pkginfo

More Munki Features

Advanced Munki

Related tasks

More

Product-specific notes

Legacy Documentation

Clone this wiki locally