1
votes

I have created a OS x pkg using package maker, that install a custom SDK and Xcode plug-in, the permissions of the payload are set to root:admin and chmod 775, as recommended.

That works fine on OS X 10.6(Snow Leopard) with Packages created with Xcode 3.2 and Xcode 4.0, but in OS X 10.7 (Lion) with Xcode 4.1, the permissions of the files are some how changed to root:wheel

If i create the 10.7 package in 10.6, the permissions are set correctly. Any ideas if there was some change in 10.7 or Xcode 4.1 with respect package permissions?

2
I had the same problem, did you find a solution? Have you tested Xcode 4.2?catlan
I finally create the 10.7 installer in 10.6 with tools provided with Xcode 4.0, I wasn't able to get it working with Xcode 4.1 tools, but the installer created with OSx 10.6 and Xcode 4.0 tools works fine on Lion, just the paint to switch to a different OSx version to create the installer, all permissions are set correctly doing that way. Let me know if you found what is the problem.José
At the moment I change the permissions in an postflight script - not happy with the solution prefer it over building package on 10.6catlan
I also try this, but my package install an Xcode SDK, and the installer with 4.2 was modifying the permissions of /Developer/SDKs based install directories, and i don't want my script to modify files that it not install. And as i build packages for both Xcode 4.0 and 4.2 i still need to use 10.6.José

2 Answers

1
votes

PackageMaker, or rather /usr/sbin/installer, tends to disregard the owner and permissions that are specified when building the package. You have to set the owner and permissions of the payload before adding it to PackageMaker.

If you're building with packagemaker on the commandline make sure you specify --no-recommend, otherwise it'll apply "recommended" permissions from your system to the package.

0
votes

I am not sure if this is what you want, but see the docs here: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/pkgbuild.1.html

specifically this part:

--ownership (recommended | preserve | preserve-other) By default, when the payload is archived into the package, the recommended UID and GID will be applied to all files. (Generally, this will be root:wheel, which ensures that files installed in the system domain are root-owned, while files installed in the user home directory will be owned by that user.) If you have special ownership requirements, you should use chmod(1) to adjust the ownership of the source files, and use --ownership preserve so that pkgbuild archives the exact ownership of the on-disk files. Alternatively, if you have just a few files to adjust, --ownership preserve-other will apply the recom-mended recommended mended UID and GID to those files that are owned by the user running pkgbuild, but leave other files unchanged. Note that pkgbuild never changes the ownership of the actual on-disk files, only the ownership that is archived into the package.