I am trying to construct a .dmg containing my application bundle, an examples directory, and a readme file. I use a shell script to construct the directory "G4beamline-3.01" containing them, and then do
$ hdiutil create -srcdir G4beamline-3.01 G4beamline-3.01.dmg
...................................................................
hdiutil: create failed - error -5341
What does that error mean? How can I fix it?
Here's the crazy part -- if I move the app bundle out of that directory, I can create two .dmg-s:
$ mv G4beamline-3.01/G4beamline.app .
$ hdiutil create -srcdir G4beamline-3.01 one.dmg
....................................
created: ...path/one.dmg
$ hdiutil create -srcdir G4beamline.app two.dmg
...................................................................
created: ...path/two.dmg
So the puzzle is: why is it that it can create the .dmg when the two pieces are separate, but not when they are together (as required)?
Note that all .dmg-s open normally, and if there is an app inside it runs correctly. There is plenty of space on the drive. In Terminal I did "su - g4bl" to build the app as a user other than the primary user, but tests as the primary user give the same error. Inside the app bundle I of course copied all non-system dylib-s into Contents/lib, and used install_name_tool to modify all executables and dylib-s to reference them there. This used to work, but with an older version of the app bundle.
In an attempt to fix this, I just re-installed Mac OS X (Mavericks), and did software update. No change.