Overall, revisiting the package building process from the beginning and leveraging tools like autopkg might be a better approach, but sometimes you just have to convert.Ĭheck the man page of pkgbuild and/or my book for more detail. Obviously, the pkg will not be able to 'Fill User Template' or 'Fill Every User' but this should work. We have a pro tip that goes over the steps to convert those. (I like to include the version in the pkg file name, but that is entirely optional.)ģ) cleanup: unmount the dmg $ hdiutil detach /Volumes/Sample This will create Sample-1.0.pkg in your current working directory. This will output a bunch of info, the very last bit is the mount point of the dmg /Volumes/Sample (the name will depend on the dmg)Ģ) build a pkg with the contents of the mounted dmg as a payload: $ pkgbuild -root /Volumes/Sample -version 1.0 -identifier -install-location / Sample-1.0.pkg That said, you could convert a dmg created with composer to a pkg with the following sequence of commands:ġ) mount the dmg: $ hdiutil attach /path/to/Sample.dmg It explores how to inspect packages with pkgutil, Pacifist and Suspicious Package, how to build them from scratch with pkgbuild and productbuild but also third party tools such as Whitebox Packages, munkipkg and Composer.