参考:
https://www.unix.com/man-page/osx/1/pkgbuild/
Pkgbuild 创建component package(pkg文件)。
productbuild 创建product archive(也是个pkg文件,可以包含多个component package)。
pkgutil可以展开prodcut archive 做一些修改,然后再生成新的archive。
pkgbuild --analyze --root ./build_path DemoComponents.plist
pkgbuild --root ./build_path --component-plist DemoComponents.plist --scripts ./Scripts --identifier "Demo.pkg" --install-location /Applications Demo.pkg
productbuild --synthesize --package Demo.pkg Distribution.xml
productbuild --distribution Distribution.xml --package-path Demo.pkg --resources Resources Demo_Installer.pkg
pkgutil –expand thePackage.pkg /destination
pkgutil --flatten